Proprep - Principles of Programming - Chapter 1 - Machine Level Representation of Data - Workbook Uk
Proprep - Principles of Programming - Chapter 1 - Machine Level Representation of Data - Workbook Uk
Table of Contents
Answer Key
a. (89)10 b. (437)10
a. (11101101)2 b. (101100111)2 c. (11101000001)2 d. (1010110001000100)2
a. (01000010)2 b. (11011001)2 c. (00111111010)2 d. (1100110111011011)2
a. (FO)16 b. (FB)16 c. (044C)16 d. (6358)16 e. (1B580)16
a. When dealing with a bit or group of bits.
b. For lengthy numbers that would be inconvenient to write out as binary,
and that could be grouped as nibbles.
All the same.
Given the binary number (101100110110)2, state the value in decimal for:
a. an unsigned number
b. a signed number using sign and magnitude
c. a signed number using two’s complement
How many bits would be required to store the decimal number -32000 in two’s
complement representation?
Assume the following operations are carried out using 8 bits. Using binary addition
subtract the second number from the first, showing your working in each case:
a. (1010111)2, (11011)2
b. (11101111)2, (1101001)2
c. (0111)2, (110101)2
Answer Key
a. (86)10 b. (-22)10 c. (-42)10
a. (2870)10 b. (-822)10 c. (-1226)10
a. (1100000000)2 b. (100000000)2
a. (101010001110)2 b. (110101110010)2
a. -2048…2047 b. -2047…2047
16
a. (000011111110)2 b. (000110110000)2 c. (010101100101)2
a. 00111100 b. 10000110 c. 11010010
Assuming you have 12 bits available, encode the following decimal numbers in fixed point
binary representations:
a. 17.5
b. -37.75
c. 253.0625
Assuming two’s complement encoding, and given an 8 bit mantissa and 4 bit exponent,
convert the following into denary:
a. 00100000 1011
b. 11101101 0110
c. 10110000 1100
Using sign and magnitude for the mantissa and two’s complement for the exponent,
express the following as binary with a sign bit as the MSB, followed by 4 bits for the
exponent, and 11 bits for the mantissa (SEEEEMMMMMMMMMMM):
a. 13.375
b. -31.25
c. -92.9375
Normalize the following binary representations, all of which use a two’s complement 16 bit
encoding with the least significant 4 bits representing the mantissa:
a. 0001010101110101
b. 1111010110000100
c. 1110111000001110
Answer Key
a. (11011100)2 b. (11110010)2 c. (01111110)2 d. (01001011)2
a. (000010001100)2 b. (111011010010)2 c.(111111010001)2
a. (1.375)10 b. (-2.75)10
a. (0.0078125)10 b. (-9.5)10 c. (-0.0390625)10
a. (0001111010110000)2 b. (1010011111010000)2 c. (1011010111001110)2
a. (0101010111000011)2 b. (1010110000000001)2 c. (1011100000001100)2