0% found this document useful (0 votes)
33 views

Computer Organization and Assembly Language

This document discusses binary, hexadecimal, and two's complement representations of positive and negative numbers. It provides examples of converting between decimal, binary, and hexadecimal notations. It also demonstrates how to perform binary subtraction using two's complement addition. The key points are: - Negative decimal numbers are represented using two's complement notation in binary. - The most significant bit determines if a hexadecimal number is positive (if 0) or negative (if 1). - To subtract binary numbers, first convert the numbers to two's complement form, negate the second number, then add them. - Conversions can be done between binary, hexadecimal and decimal notations. - For a signed hexadecimal number,
Copyright
© © All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as PDF, TXT or read online on Scribd
0% found this document useful (0 votes)
33 views

Computer Organization and Assembly Language

This document discusses binary, hexadecimal, and two's complement representations of positive and negative numbers. It provides examples of converting between decimal, binary, and hexadecimal notations. It also demonstrates how to perform binary subtraction using two's complement addition. The key points are: - Negative decimal numbers are represented using two's complement notation in binary. - The most significant bit determines if a hexadecimal number is positive (if 0) or negative (if 1). - To subtract binary numbers, first convert the numbers to two's complement form, negate the second number, then add them. - Conversions can be done between binary, hexadecimal and decimal notations. - For a signed hexadecimal number,
Copyright
© © All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as PDF, TXT or read online on Scribd
You are on page 1/ 4

Question No 1:

In a 16-bit binary representation, the decimal integer -120 would be represented using Two's
complement notation. Here's how it's done:

Convert 120 to binary:


120 in binary is 1111000.

Invert the bits (change 0s to 1s and 1s to 0s):


1111000 becomes 0000111.

Add 1 to the inverted value:


0000111 + 1 = 0001000.

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.

01100011 in decimal is 99. So, the result is 99.

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.

01101100 in decimal is 108. So, the result is 108.


Question No 4:
1001011 to hexadecimal:

1001011 in binary is equivalent to 4B in hexadecimal.


10010101101110 to hexadecimal:

10010101101110 in binary is equivalent to 4B5E in hexadecimal.


A2Ch to binary:

A2C in hexadecimal is equivalent to 101000101100 in binary.


B34Dh to binary:

B34D in hexadecimal is equivalent to 1011001101001101 in binary.


Question No 5:
Here are the unsigned and signed decimal interpretations of the given hexadecimal numbers:

7FFEh:

Unsigned Decimal: 7FFE in hexadecimal is 32,766 in decimal.


Signed Decimal: Since the most significant bit (MSB) is 0, it’s a positive number, so the signed
decimal interpretation is the same as the unsigned: 32,766.
8543h:
Unsigned Decimal: 8543 in hexadecimal is 33,315 in decimal.
Signed Decimal: To determine the signed decimal interpretation, you need to consider the MSB,
which is 8 (in binary, the MSB is 1). This indicates a negative number in two’s complement
notation. To find the signed decimal value, you would need to perform two’s complement
conversion, which would make it a negative number. However, to provide the signed decimal
value, I would need to know the total number of bits being used to represent this value (e.g., 16-
bit, 32-bit, etc.). If you specify the number of bits, I can assist further.

You might also like