Notes_Lesson1
Notes_Lesson1
Denary(Decimal) Numbers- Base 10 numbers. This uses the digits 0 to 9 which are placed
in ‘weighted’ columns.
Binary Number Systems - Base 2 number system with digits 0 & 1. A switch in
the ON position can be represented by 1; a switch in the OFF position can be
represented by 0. Each of the binary digits are known as bits.
The binary system uses 1s and 0s only which gives these corresponding
weightings:
128 64 32 16 8 4 2 1
27 26 25 24 23 22 21 20
Convert 1 1 1 0 1 1 1 0 to denary
2 107 Reminde
r1
2 53 1
2 26 0
2 13 1
2 6 0
2 3 1
2 1 1
2 0 0
Each time a 1 appears in a column, the column value is added to the total. For
example, the binary number above is:
128 + 64 + 32 + 8 + 4 + 2 = 238 (denary)
Two’s compliment :-
Each digit in the binary number is inverted and a ‘1’ is added to the right-most
bit. For example, 0 1 0 1 1 0 1 0 (denary value 90) becomes:
10100101
+1
= 1 0 1 0 0 1 1 0 (since 1 + 1 = 0, a carry of 1) = denary value −90
The two’s complement uses these weightings for an 8-bit number
representation:
−128 64 32 16 8 4 2 1
This means:
−128 64 32 16 8 4 2 1
1 1 0 1 1 0 1 0
0 0 1 0 0 1 1 0
0 0 1 0 0 1 0 1
+
0 0 1 1 1 0 1 0
=
0 1 0 1 1 1 1 1
Binary subtraction
To carry out subtraction in binary, we convert the number being subtracted into
its negative equivalent using two’s complement, and then add the two numbers.
Carry out the subtraction 95 – 68 in binary. Example 1.3
Solution
1 Convert the two numbers into binary:
95 = 0 1 0 1 1 1 1 1
68 = 0 1 0 0 0 1 0 0
2 Find the two’s complement of 68:
invert the digits: 1 0 1 1 1 0 1 1
add 1: 1
which gives: 1 0 1 1 1 1 0 0 = −68
3 Add 95 and −68:
−128 64 32 16 8 4 2 1
0 1 0 1 1 1 1 1
+
1 0 1 1 1 1 0 0
=
100011011
The additional ninth bit is simply ignored leaving the binary number 0 0 0 1 1 0 1 1
(denary equivalent of 27, which is the correct result of the subtraction).
Measurement of the size of computer memories
The byte is the smallest unit of memory in a computer. Some computers use
larger bytes, such as 16-bit systems and 32-bit systems, but they are always
multiples of 8. 1 byte of memory wouldn’t allow you to store very much
information; so memory size is measured in these multiples.