ICT114 - Tutorial 1
Seminar 1: Number Systems and Computer Logic
Recap
1. Most Significant Bit (MSB) and Least Significant Bit (LSB)
bit position: 7 6 5 4 3 2 1 0
MSB LSB
2. Unsigned integers: positive numbers.
3. Signed integers:
• First bit is sign bit
• ‘1’ => negative
• ‘0’ => positive
• Represented by sign-magnitude or 2’s complement system
4. 2’s Complement System
• For positive number (sign bit = 0), same as sign-magnitude representation.
• For negative number, it will be dealt with differently.
• Usually the word length (# of bits per data word) for the representation is given.
Computation must be based on the word length. Word lengths are usually multiples of 8-
bit.
Exercises
1. Assume an 8-bit word length, convert 0000 10112 to decimal. [1110]
0000 10112 =
2. Assume an 8-bit word length, convert 8910 to binary. [0101 10012]
8910 =
3. Convert 3E16 to decimal. [6210]
3E16 =
4. Convert 85910 to hexadecimal (obtain remainders by dividing by 16). [35B16]
85910 =
5. Convert ABC16 to binary (1 hex digit = 4 bits). [1010 1011 11002]
ABC16 =
6. Convert the 2’s complement representation 1001 01012 to decimal. [-10710]
ICT114 - Tutorial 1 Page 1
7. Convert 107 to 2’s complement. [0110 10112]
8. Convert -107 to 2’s complement. [1001 01012]
9. What is the 8-bit 2’s complement binary value of the negative denary number -75? [1011
0101]
10. A microprocessor with 8-bit memory contents has in one of its location the value BE16.
(a) What decimal number would this value represent if the memory contents were to be
interpreted as:
(i) an 8-bit unsigned integer; [190]
(ii) an 8-bit 2’s complement integer; and [-66]
(iii) a fixed-point fraction with four bits before and four bits after the decimal point.
[11.875]
(b) Assume the contents of the memory location were to be interpreted as an ASCII-coded
character where the most significant bit is a parity or error checking bit. What would this
character be? [>]
11. Assume that the binary value 1101 0001 is stored in a computer’s main memory.
(i) What character would this value represent if it was to be interpreted as an ASCII
character code with the most significant bit being used as a parity or error checking bit?
[Q]
(ii) What is the denary equivalent of the binary value if it is interpreted as an 8-bit unsigned
integer? [209]
(iii) What is the hexadecimal equivalent of the binary value? [D1]
12. A speech sound signal is quantised using an 8-bit 2’s complement linear coding system. The
coding system is such that a sound voltage level of -12.8 volts is represented by a binary value
of 1000 0000 and a level of +12.7 volts by a binary value of 0111 1111. What binary codes
would be stored for speech sample voltage levels of:
(i) +10.0 volts, [0110 0100]
(ii) -1.0 volts? [1111 0110]
ICT114 - Tutorial 1 Page 2