Notes For Computer Science 2210 Chapter 1
Notes For Computer Science 2210 Chapter 1
TABLE OF CONTENTS
1.1.2 Binary, denary, and hexadecimal systems..........................................................................2
Converting from binary to denary...............................................................................................................2
ACTIVITY 1.1 (answers)....................................................................................................................2
Converting from denary to binary...............................................................................................................3
ACTIVITY 1.2 (aNSWERS).................................................................................................................4
The hexadecimal system.................................................................................................................................5
Converting from binary to hexadecimal and from hexadecimal to binary................................6
activity 1.3 (answers)........................................................................................................................7
Converting from hexadecimal to binary................................................................................................7
ACTIVITY 1.4(ANSWERS)..................................................................................................................8
Converting from hexadecimal to denary and from denary to hexadecimal..............................8
ACTIVITY 1.5(ANSWERS)..................................................................................................................9
convert from denary to hexadecimal..............................................................................................................9
ACTIVITY 1.6(ANSWERS)................................................................................................................10
1.1.4 Addition of binary numbers......................................................................................................10
ACTIVITY 1.8(aNSWERS).................................................................................................................11
ACTIVITY 1.9(Answers)...................................................................................................................12
ACTIVITY 1.10(ANSWERS)...............................................................................................................13
Activity 1.11(answers).....................................................................................................................13
1.1.6 Two’s complement (binary numbers)........................................................................................14
Activity 1.12 (Answers).......................................................................................................................................14
ACTIVITY 1.13(aNSWERS)..........................................................................................................15
ACTIVITY 1.14(ANSWERS)...............................................................................................................15
ACTIVITY 1.5 (ANSWERS)...............................................................................................................16
ACTIVITY 1.16(ANSWERS)...............................................................................................................16
1
1.1.2 BINARY, DENARY, AND HEXADECIMAL SYSTEMS
a. 51
2
b. 127
c. 153
d. 116
e. 255
f. 15
g. 143
h. 179
i. 112
j. 238
k. 487
l. 1364
m. 3855
n. 1992
o. 2047
p. 31984
q. 16141
r. 49983
s. 34952
t. 32767
3
ACTIVITY 1.2 (ANSWERS)
Convert the following denary numbers into binary (using both methods):
a. 00101001
b. 01000011
c. 01010110
d. 01100100
e. 01101111
f. 01111111
4
g. 10010000
h. 10111101
i. 11001000
j. 11111111
k. 1000000011101000
l. 0000001101111000
m. 0000111111111111
n. 0100000000010000
o. 1111001101100011
It is a system based on 16 different digits, the numbers 0 to 9 and the letters A to F are
used to represent each hexadecimal (hex) digit.
A in hex = 10 in denary,
B = 11,
C = 12,
D = 13,
E = 14 and
F = 15
Using the same method as for denary and binary, this gives the headings 16 0, 161 ,
162 , 163, and so on. The typical headings for a hexadecimal number with five digits
would be:
5
CONVERTING FROM BINARY TO HEXADECIMAL AND FROM
HEXADECIMAL TO BINARY
6
ACTIVITY 1.3 (ANSWERS)
a. C3
b. F7
c. 27F
d. 4EE
e. 1E1
f. 89E
g. (0)4FE
h. (0)E9C
i. FF7D
j. 67AE
ACTIVITY 1.4(ANSWERS)
a. 0110 1100
b. 0101 1001
c. 1010 1010
7
d. 1010 0000 0000
ACTIVITY 1.5(ANSWERS)
a. 107
b. 156
c. 74
d. 255
e. 511
f. 2561
8
g. 2996
h. 3240
i. 4782
j. 44425
ACTIVITY 1.6(ANSWERS)
a. 62
b. E3
c. 1EA
d. 1FF
e. 33A
f. 3E8
g. A4A
h. E9F
9
i. FA7
j. 1388
ACTIVITY 1.8(ANSWERS)
Carry out the following binary additions:
a.10000011
b. 01100110
10
c.01111011
d .10110110
e. 01101111
f. 10110111
g. 01111110
h. 01110000
i. 11111110
j. 11011101
ACTIVITY 1.9(ANSWERS)
Convert the following denary numbers into binary and then carry out the
binary addition of the two numbers and check your answer against the
equivalent denary sum:
OVERFLOW
11
The generation of a 9th bit is a clear indication that the sum has exceeded this value.
This is known as an overflow error and in this case is an indication that a number is too
big to be stored in the computer using 8 bits.
ACTIVITY 1.10(ANSWERS)
Q1. Convert the following pairs of denary numbers to 8-bit binary numbers and then
add the binary numbers. Comment on your answers in each case:
Q2. Carry out the following 16-bit binary additions and comment on your
answers:
ACTIVITY 1.11(ANSWERS)
12
b. denary value is 13 (104 ÷ 8) therefore shift three places right is the same as division
by 23 (i.e. 8)
b .sum = 01010000
c. 00001010
d .75 = 01001011
e. 01010101
f .10101010
b. 01000010
c. 01011000
d.01100110
e.01101111
f .01111101
g. 01001101
h. 00010100
i. 00110001
j. 00111000
Q2. A. 85
b. 51
13
c. 76
d. 126
e. 15
f .125
g. 65
h. 30
i. 113
j. 120
ACTIVITY 1.13(ANSWERS)
Convert the following negative denary numbers into binary numbers using
the two’s complement format:
a .11101110
b. 11100001
c. 11010001
d. 11000001
e. 10101000
f. 10100100
g. 10011100
h. 11111111
i. 11110000
j. 10000001
ACTIVITY 1.14(ANSWERS)
a .−51
b. −66
c .−17
14
d. −121
e. −96
f. −7
g. −81
h. −1
i. −127
j. −10
ii .The coding system for all the characters on a standard keyboard and control codes;
extended ASCII, gives another 128 codes to allow for characters in non-English
alphabets and for some graphical characters to be included.
iii. The coding system which represents all the languages of the world (the first 128
characters are the same as ASCII code).
iv 256 × 256 × 256 = 16 777 216 possible colours 3 They both increase the size of the
sound file.
ACTIVITY 1.16(ANSWERS)
15
ANSWERS TO EXAM-STYLE QUESTIONS
ANSWERS TO QUESTIONS 6 AND 7 IN THIS SECTION ARE EXAMPLE ANSWERS FOR PAST PAPER
QUESTIONS. THE DETAILS OF THE RELEVANT PAST PAPER CAN BE FOUND WITH THE
CORRESPONDING EXAM-STYLE QUESTION IN THE STUDENT’S BOOK.
16
17
18
19
20