Review Worksheet Part 1: Unsigned 8-Bit Arithmetic: Girum Ibssa
Review Worksheet Part 1: Unsigned 8-Bit Arithmetic: Girum Ibssa
Girum Ibssa
Review Worksheet
For unsigned, 8-bit numbers, what is the value (in decimal) of each of the following numbers:
00000000 ______
0 12
00001100 ______
11111111 ______
255 16
00010000 ______
128
10000000 ______
For unsigned numbers, what is the range of values that can fit in 8 bits?
binary decimal
00000000
Min: _____________ _________________
0
11111111
Max: _____________ 255
_________________
In binary arithmetic, an unsigned operation whose result does not lie in this range produces a carry.
The range 0 through (2^n) - 1, where n is the number of bits.
Write two numbers within the range that, if added, result in a number outside of the range. (Write the same
numbers in decimal as well as binary - truncate the binary sum to 8 bits, write the truncation of the binary
answer in decimal.)
binary decimal
11111101
______ 253
_______
00000011
+ ______ 3
+ _______
[1]00000001
______ [255] +1
_______
What is a general algorithm that could be used to determine if the sum of two unsigned numbers is out of
range?
Just check to see if the carry bit was tripped.
Part 2: Signed 2's Compliment 8-bit arithmetic
For signed, 8-bit numbers, what is the value (in decimal) of each of the following 2's complement binary
numbers:
0
00000000 ______ 28
00011100 ______
11111111 ______
-1 20
00010100 ______
-128
10000000 ______
For 2's complement signed numbers, what is the range of values that can fit in 8 bits?
binary decimal
10000000
Min: _____________ -128
_________________
01111111
Max: _____________ 127
_________________
In binary arithmetic, a signed operation whose result does not lie in this range produces an overflow.
The range -(2^n)/2 through [(2^n)/2] - 1, where n is the number of bits.
Write two negative numbers within the range that, if added, result in a number outside of the range. (Write
the same numbers in decimal as well as binary - truncate the binary sum to 8 bits, write the truncation of the
binary answer in decimal.)
binary decimal
11111111
______ -1
_______
10000000
+ ______ + _______
-128
01111111
______ 127!
_______
00hex
00000000 ______ 00001011 0Bhex
______
FFhex
11111111 ______ 00010001 ______
11hex
88hex
10001000 ______
What is a general algorithm that could be used to determine if the sum of two signed numbers is out of
range?
Check if the carry bit has been tripped.