CS 237 Midterm #1
2^5
^32
Given the following two's complementary binary words, show the equivalent two's complement hexadecimal word
each group of 4 binary bits = one hex character. ex. 1001 1101 0110 1110 9 D 5 E
(+) - (-)=
(+) + (+); Overflow if answer is (-)
(+) - (+)=
(+) + (-); No Overflow
(-) - (-)=
(-) + (+); No Overflow
(-) - (+) =
(-) + (-); Overflow if answer is (+)
Given the following two's complement hexadecimal bytes, show the equivalent value in decimal.
00-7f: are positive so find decimal regularly. 80-FF: are negative, subtract form 00 and then find the decimal and add a negative sign.
0
0000
1
0001
2
0010
3
0011
4
0100
5
0101
6
0110
7
0111
2^0
1
8
1000
9
1001
10-A
1010
11-B
1011
2^10
1024
12-C
1100
13-D
1101
14-E
1110
15-F
1111
2^7
128
2^4
16
word
16
2^14
16384
2^1
2
2^11
2048
2^8
256
long
32
2^15
32768
2^2
4
2^12
4096
2^9
512
2^6
64
2^16
65536
2^3
8
byte
8
2^13
8192
Given the following decimal numbers, show the equivalent as a two's complement HEXADECIMAL WORD
If its a negative find the hexadecimal regularly and then subtract from 00.
Given the decimal numbers, show the equivalent as a two's complement BINARY BYTE.
If its a negative then find the binary, "flip, switch and add one"
Given the followings two's complement binary bytes, show the equivalent value in decimal
If the binary starts with 1, "flip,switch, add one" then find the decimal regularly adding a negative sign in front of it