Professional Documents
Culture Documents
SECTION A
Multiple Choice Questions
1. The number system of choice, both for data storage and for all internal processing of
operations is _______
a) binary
b) decimal
c) octal
d) hexadecimal
5. The code form that can represent the most characters is_______.
a) ASCII
b) EBCDIC
c) Unicode
d) IBM
7. When a key is struck on the keyboard, the circuitry in the keyboard generates a binary
code called a _______.
a) scan code
b) ASCII code
c) EBCDIC code
d) Unicode
9. The alphanumeric code system that allows the largest number of values is called
_______.
a) EBCDIC
b) Unicode
c) ASCII
d) ANSI
13. Two-valued variables or constants with values of true or false are called _______.
a) Boolean
b) Character
c) Enumerated data type
d) Integer
SECTION B
Exercises
14. How many bits of memory are contained in a memory unit with memory capacity of:
i) 2MB
ii) 512KB
iii) 256GB
a) 5210
b) 9110
c) 15010
d) 6310
e) 12610
a) 11102
b) 111 11112
c) 1111 10012
d) 100 10012
e) 1 0000 00012
a) 11011 + 1101
b) 11010101 + 00111110
c) 1111 + 1
d) 111111 + 1
e) 10101010 + 01010101
a) 10 10002
b) 1 0001 00112
c) 10 0002
d) 1000 0002
e) 1111 1112
a) -128
b) -4
c) -86
d) 13
e) -41
20. What extra step do we take when we form the 2's complement of a negative binary
number?
Answer
The extra step we take is adding 1 to our complemented number. A good way to
remember this is to compare the names of the representation schemes. 2's complement
exceeds 1's complement by 1, so we always add 1 to our complemented numbers
when using 2's complement.
21. Write the 2's complement for each of the following 5-bit binary numbers.
a) 010012
b) 010112
c) 001112
d) 000012
Answer
The 2's complement for each number is given below.
a) 101112
b) 101012
c) 110012
d) 111112
22. In 2's complement, what do all the positive numbers have in common?
23. If you want to write the number 710 using 2's complement representation, what do you
need to do?
To write the number 710 using 2's complement representation you need only to
convert 710 to binary.
24. If you want to write the number -710 using 2's complement representation, what do you
need to do?
To write the number -710 using 2's complement representation you need to
convert 710 to binary, complement this number, and then add 1. Remember that
2's complement exceeds 1's complement by 1.
25. What is the general technique for converting a decimal number to 2's
complement representation?
26. Convert the following decimal numbers to binary using 6-bit 2's complement
representation.
a) -1610
b) 1310
c) -310
d) -1010
e) 2610
f) -3110
27. Work out the 2s complement binary representation of the following decimal numbers,
using 8 bits.
a) 9710
b) -12710
c) -2910
d) -7610
e) -210
a) 0110 00012
b) 1000 00012
c) 1110 00112
d) 1011 01002
e) 1111 11102
28. Subtraction
Work out the following subtractions in 2s complement binary (do this by negating the
second number and then adding). Use an 8-bit representation. In each case, check
your answer by converting the numbers and the result into decimal.
a) 00011011 00001101
b) 11010101 00111110
c) 00001111 00000001
d) 00111111 00000001
e) 10101010 01010101
a) 0000 11102
b) 1001 01112
c) 0000 11102
d) 0011 11102
e) 0101 01012
29. Hexadecimal
Convert the following hexadecimal numbers into binary and decimal.
a) 3A
b) FF
c) A5
d) 32
e) BD
a) 11 10102, 58
b) 1111 11112, 255
c) 1010 01012, 165
d) 11 00102, 50
e) 1011 11012, 189
30. Convert the following decimal numbers into hexadecimal (an easy way to do this is to
convert into binary firs).
a) 254
b) 256
c) 64
d) 181
e) 99
a) FE
b) 100
c) 40
d) B5
e) 63