

Study with the several resources on Docsity
Earn points by helping other students or get them with a premium plan
Prepare for your exams
Study with the several resources on Docsity
Earn points to download
Earn points by helping other students or get them with a premium plan
Community
Ask the community for help and clear up your study doubts
Discover the best universities in your country according to Docsity users
Free resources
Download our free guides on studying techniques, anxiety management strategies, and thesis advice from Docsity tutors
What decimal value does the two's complement 110011 represent? It must be a negative number, since the most significant bit (msb) is a 1. Therefore, find the ...
Typology: Exams
1 / 3
This page cannot be seen from the preview
Don't miss anything!
The 2’s representation is a variation on 1's complement which does not have 2 representations for 0. This makes the hardware that does arithmetic (addition, really) faster than for the other representations.
A 3-bit example: bit pattern: 100 101 110 111 000 001 010 011
1's comp: -3 -2 -1 0 0 1 2 3
2's comp: -4 -3 -2 -1 0 1 2 3
The negative values are all "slid" down by one, eliminating the extra zero representation.
To add, subtract, or multiply two complement numbers, just perform the operation as if the numbers are unsigned, and throw away any additional bits generated. To perform negation, form the ones complement (subtract from all ones (the representation of -1), then add 1.
How to get an integer in 2's comp. representation:
The positive values are the same as for sign mag. and 1's comp. They will have a 0 in the MSB (but it is NOT a sign bit!)
Positive: just write down the value as before Negative: use the positive value 00101 (+5) take the 1's comp. 11010 (-5 in 1's comp) add 1 + 1
11011 (-5 in 2's comp)
For example -30 is represented as 11111111 - 00011110 + 1 = 11100001
To get the additive inverse of a 2's comp integer,
Exercise What is the bit pattern for decimal 42 and -42 as 8 bit two’s complement numbers?
To add 1 without really knowing how to add: Start at LSB, for each bit (working right to left)
Example: What decimal value does the two's complement 110011 represent?
It must be a negative number, since the most significant bit (msb) is a 1. Therefore, find the additive inverse:
110011 (2's comp. -?) 001100 (1's complement)
001101 (2's comp. +13)