Computer Organization and Assembly Language
Computer Organization and Assembly Language
In a 16-bit binary representation, the decimal integer -120 would be represented using Two's
complement notation. Here's how it's done:
So, the decimal integer -120 in a 16-bit register using Two's complement representation is
1111111111111000.
Question No 2:
To determine whether 16-bit hexadecimal numbers are positive or negative, you can look at the
most significant bit (the leftmost bit). If it’s 0, the number is positive; if it’s 1, the number is
negative.
CB33h:
Binary: 1100101100110011
The most significant bit is 1, so this is a negative number.
807Fh:
Binary: 1000000001111111
The most significant bit is 1, so this is a negative number.
9AC4h:
Binary: 1001101011000100
The most significant bit is 1, so this is a negative number.
So, all three of these 16-bit hexadecimal numbers are negative.
Question No 3:
To perform binary subtractions using two’s complement addition, follow these steps:
10110100 – 10010111:
First, represent the numbers in two’s complement form. Since subtraction is addition of the
negation, you’ll need to negate the second number and then add them.
Convert 10010111 to its two’s complement by inverting the bits and adding 1: 01101001.
Now, add 10110100 and 01101001:
10110100
+ 01101001
100111101
The result is 100111101, which is the two’s complement form of the subtraction.
To convert it back to decimal: Negate the result (inverting bits and adding 1), which is equivalent
to taking the two’s complement: 01100011.
10001011 – 11110111:
Convert 11110111 to its two’s complement: 00001001 (inverting bits and adding 1).
Now, add 10001011 and 00001001:
10001011
+ 00001001
10010100
The result is 10010100, which is the two’s complement form of the subtraction.
To convert it back to decimal: Negate the result (inverting bits and adding 1), which is equivalent
to taking the two’s complement: 01101100.
7FFEh: