Given pair of 16 bit binary data
Question
Given pair of 16 bit binary data:
X = 1110 0111 100100000
Y = 01111000 1110 0000
- Suppose X and Y are 16 bit unsigned integers, convert them into hexadecimal numbers.
- S0 X and Y are in 16 bit signed 2’s complement format, convert them into decimal integers.
- Suppose X and Y are base 2 non negative fractional numbers, with the right most half byte of data representing the fractional part. Convert them back to their decimal representations.
- Binary addition may carry different physical meaning when the data format varies from one another. Compute Z= X+Y using 8 bit places. Name, respectively, the decimal equivalence of Z if X and Y are in the data format described in (a)-(c). Hence, determine which of them is/are giving a correct decimal result.
Summary
Here we take two numbers and assigned them the value of X and Y. After they declare they will get converted into a hexadecimal number. By 16 bit unsigned binary number. After that, they will get converted into decimal numbers by 16 bit signed numbers who are 2’s complement numbers. So next is that fraction equivalent is found by the last 4 bits of two numbers. Also, their decimal number also gets find along with that.
Explanation
a] 16 bit unsigned integers range from 0000 to (FFFF) in hexadecimal.
X= 110 0111 1001 1111
Y= 0111 1000 1110 0000
In hexadecimal:
(X)= 1110 0111 1001 1111
E 7 9 F
=(E79F)
(Y)= 0111 1000 1110 0000
7 8 E 0
=(78E0)
b] X &Y are 16 bit 2’s compliment form:
X AND Y in normal form:
X= 0001 1000 0110 0001
Y= 1000 0111 0010 0000
Decimal form:
X= 2+2+2+2+2
=(6241)
X= 2+2+2+2+2
=(34592)
c] rightmost half byte is the fractional part.
X= (2+2+2+2+2+2+2+2) +(2+2+2+2)
= 3705+0.9375
Y= (2+2+2+2+2+2+2)+0
=(1934)
d] Z=X+Y
1110 0111 1001 1111
0111 1000 1110 0000
10110 0000 011 1111
Z= (10110 0000 0111 1111)
=(90239)
=(1607F)