Professional Documents
Culture Documents
End Show
Unit 2 Data Representation and Internal
Operations of the Computer
End Show
End Show
End Show
Egyptian
3rd Century BC
End Show
End Show
Cretan
1200-1700BC
End Show
End Show
End Show
End Show
Roman Numerals
1 I
2 II
3 III
4 IV
5 V
6 VI
10X
11XI
16XVI
20 XX
25 XXV
29 XIX
50 L
75 LXXV
100 C
500 D
1000M
XXXVI
XL
XVII
DCCLVI
MCMLXIX
End Show
What is this ?
This is also a symbol
Five (5)
End Show
Symbols to represent certain quantities
0
1
10
End Show
How do you represent this quantity on a spike abacus?
End Show
End Show
End Show
End Show
End Show
End Show
End Show
End Show
End Show
End Show
End Show
End Show
End Show
102
101
100
End Show
End Show
Abacus
Roman
Abacus
Chinese
Abacus
Japanese
Soroban
(Abacus)
End Show
End Show
These
symbols
are
processed
internally by components that can
maintain a limited number of discrete
states.
To
End Show
Decimal Number system Place Values
We normally use the decimal number system to
represent quantities and perform calculations.
342
Hundreds
3 x 100
Tens
4 x 10
Ones
2x1
End Show
343
Hundreds
3 x 100
Tens
4 x 10
Ones
3x1
End Show
344
Hundreds
3 x 100
Tens
4 x 10
Ones
4x1
End Show
345
Hundreds
3 x 100
Tens
4 x 10
Ones
5x1
End Show
346
Hundreds
3 x 100
Tens
4 x 10
Ones
6x1
End Show
347
Hundreds
3 x 100
Tens
4 x 10
Ones
7x1
End Show
348
Hundreds
3 x 100
Tens
4 x 10
Ones
8x1
End Show
349
Hundreds
3 x 100
Tens
4 x 10
Ones
9x1
End Show
350
Hundreds
3 x 100
Tens
5 x 10
Ones
0x1
End Show
End Show
312 = 300 + 10 + 2
= 3 * 100 + 1 * 10 + 2 * 1
100
= 3 * 102 + 1 * 101 + 2 *
Weighing factors
End Show
uses base 10
104
103
10000 1000
102
101
100
10-1
10-2
10-3
100
10
.1
.01
.001
End Show
0123456789
Lowest value
Highest value
17+4
17
18
+1
19
+2
20
+3
21
+4
When 9 is exceeded, we reset (0), and carry a value of 1 to
the next column on the left
End Show
..
Binary Value
24
23
22
21
20
Decimal
Value
x-1
End Show
More illustration..
The binary number system is also known as
the base 2 number system.
The values of the positions are calculated by
raising 2 to some power.
Why is 2 the base in binary numbers?
Because we use 2 digits, the digits 0 and 1.
End Show
1 0 0 1 1 0 1
2 6 25 2 4 2 3 22 2 1 20
End Show
4
0 x 23
1 x 22
0101
1
0 x 21
1 x 20
Position
Binary Value
23
22
21
20
Decimal
Value
x-1
End Show
26
25
24
23
22
21
20
128 64
32
16
End Show
01234567
End Show
64
64
64
0 x 83
3 x 82
1 x 81
1
1
1
1
4 x 80
End Show
85
84
32768 4096
83
512
82
64
81
8
80
1
End Show
End Show
16
0 x 163
256
16
256
16
256
16
1 x 162
4 x 161
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
F(15) x 160
End Show
uses base 16
includes only the symbols 0 through 9 and
the letters A, B, C, D, E, and F to represent
10, 11, 12, 13, 14, and 15 respectively.
The weighted values for each position is as follows:
163
4096
162
256
161
16
160
1
2.1.2
End Show
Binary to Decimal
Multiply each digit by its weighted position, and add
each of the weighted values.
Example
The binary value 1011 represents:
1x23 + 0x22 + 1x21 + 1x20
=1x8 + 0x4 + 1x2 + 1x1
=8 + 0 + 2 + 1
=11 (base 10)
1 0 0 1 1 0 1
2 6 2 5 24 2 3 2 2 2 1 2 0
20 = 1
21 = 2
22 = 4
23 = 8
24 = 16
25 = 32
26 = 64
End Show
X 20 = 1
0 X 2 1 = 0
1 X 2 2 = 4
1 X 2 3 = 8
0 X 2 4 = 0
0 X 2 5 = 0
1 X 26 = 64
7710
End Show
Decimal to Binary (Repeated Division By 2)
Division
Quotient
Remainder
47 / 2
23
Binary Number
1
47
23 --1
End Show
Decimal to Binary (Repeated Division By 2)
Division
Quotient
Remainder
Binary Number
47 / 2
23
23 / 2
11
11
47
23 --1
11 --1
End Show
Decimal to Binary (Repeated Division By 2)
Division
Quotient
Remainder
47 / 2
23
23 / 2
11
11 / 2
Binary Number
1
47
11 2 23 --1
111 2 11 --1
5
--1
End Show
Decimal to Binary (Repeated Division By 2)
Division
Quotient
Remainder
Binary Number
47 / 2
23
23 / 2
11
11
11 / 2
111
5/2
1111
47
2 23 --1
2
11 --1
--1
--1
End Show
Decimal to Binary (Repeated Division By 2)
Division
Quotient
Remainder
Binary Number
47 / 2
23
23 / 2
11
11
11 / 2
111
5/2
1111
2/2
01111
47
2 23 --1
2
11 --1
--1
--1
--0
End Show
Decimal to Binary (Repeated Division By 2)
Division
Quotient
Remainder
47 / 2
23
23 / 2
11
11
11 / 2
111
5/2
1111
2/2
01111
1/2
101111
4710 = 1011112
Binary Number
2
47
2 23 --1
2
11 --1
--1
--1
--0
--1
End Show
End Show
Lets find the binary equivalent of the decimal
number 254
254 / 2
127 / 2
End Show
127 / 2
63 / 2
End Show
127 / 2
63 / 2
31 / 2
End Show
127 / 2
63 / 2
31 / 2
15 / 2
gives
7 with remainder 1
End Show
127 / 2
63 / 2
31 / 2
15 / 2
gives
7 with remainder 1
7/2
gives
3 with remainder 1
End Show
127 / 2
63 / 2
31 / 2
15 / 2
gives
7 with remainder 1
7/2
gives
3 with remainder 1
3/2
gives
1 with remainder 1
End Show
127 / 2
63 / 2
31 / 2
15 / 2
gives
7 with remainder 1
7/2
gives
3 with remainder 1
3/2
gives
1 with remainder 1
1/2
gives
0 with remainder 1
111111102
127 / 2
63 / 2
31 / 2
15 / 2
gives
7 with remainder 1
7/2
gives
3 with remainder 1
3/2
gives
1 with remainder 1
1/2
gives
0 with remainder 1
LSB
MSB
111111102
End Show
End Show
1. Break the binary number into 3-bit sections from the LSB to the MSB.
2. Convert the 3-bit binary number to its octal equivalent.
001
010
111
110
110
010
End Show
Conversion from Binary to Octal
Convert 10110111 to octal.
Each octal digit is represented by 3 binary bits.
Split the binary number into groups of 3 bits,
starting from the right.
10 110 111
=2 =6 =7
= 2678
End Show
End Show
4x81
2x80
3x64
4x8
2x1
192
32
8
64
64
64
8
8
8
3 x 82
4 x 81
2 x 80
192 + 32 + 2 = 226
End Show
Conversion from Octal to Decimal
Convert 1768 to decimal.
Each column represents a power of 8,
176 = 1 * 82 + 7 * 81 + 6 * 80
= (1 * 64) + (7 * 8) + (6 * 1)
= 64 + 56 + 6
= 126
Quotient Remainder
10
Quotient Remainder
87 / 8
10
10 / 8
Quotient Remainder
87 / 8
10
10 / 8
1 / 8
8710 = 1278
End Show
1.Break the binary number into 4-bit sections from the LSB to the
MSB.
2.Convert the 4-bit binary number to its Hexa equivalent.
For example, the binary value 1010111110110010 is
written:
1010
A
1111
F
1011
B
0010
2
End Show
Conversion from binary to hexadecimal
Convert 10110 to hexadecimal.
Each hexadecimal digit represents 4 binary
bits. Split the binary number into groups of 4
bits, starting from the right.
1
0110
1
6
=16 in hexadecimal
End Show
0
1
2
3
4
5
6
7
0000
0001
0010
0011
0100
0101
0110
0111
(in 4
bits)
8
9
A
B
C
D
E
F
1000
1001
1010
1011
1100
1101
1110
1111
B
1011
2
0010
End Show
2 x 160
11 x 16
2 x 1
176
16
16
16
16
16
16
16
16
16
16
16
176 + 2 = 178
0 x 163
0 x 162
11 x 161
1
1
2 x 160
End Show
Conversion from hexadecimal to decimal
Convert hexadecimal 17616 to decimal.
Each column represents a power of 16,
17616= (1 * 162) + (7 * 161) + (6 * 160)
= (1 * 256) + (7 * 16 )+ (6 * 1)
= 256 + 112 + 6
= 374
End Show
Decimal to Hexa Decimal Conversion
To convert decimal to hexa is slightly more difficult. The typical
method to convert from decimal to hexa is repeated division by
16.
Repeated Division By 16
For this method, divide the decimal number by 16, and write the
remainder on the right hand side as the least significant digit.
This process is continued by dividing the quotient by 16 and writing
the remainder until the quotient is 0.
End Show
Ex: Convert decimal 2811 to hexa as follows:
Division
2811 / 16
Quotient Remainder
175
11 = B
End Show
Ex: Convert decimal 2811 to hexa as follows:
Division
Quotient Remainder
2811 / 16
175
11 = B
175 / 16
10
15 = F
End Show
Ex: Convert decimal 2811 to hexa as follows:
Division
Quotient Remainder
2811 / 16
175
11 = B
175 / 16
10
15 = F
10 / 16
10 = A
End Show
Ex: Convert decimal 2811 to hexa as follows:
Division
Quotient Remainder
2811 / 16
175
11 = B
175 / 16
10
15 = F
10 / 16
10 = A
281110 = AFB16
End Show
End Show
With a single bit, you can represent any two distinct
items.
Examples
one
or
zero
true or
false
on
off
or
male
or
right or
wrong
female
End Show
Data Representation
H
ASCII CODE IS 72
01001000
What is Byte ?
End Show
End Show
The bits in a byte are filled from LSB (b0) to MSB (b7)
respectively as follows:
b7 b6 b5 b4 b3 b2 b1 b0
Most Significant Bit (MSB)
1
MSB
1
LSB
End Show
Many data types have fewer than 256 items so eight bits is
usually adequate.
End Show
End Show
End Show
End Show
The number 59 is coded in BCD as follows
5
0101
1001
0011
1000
0110
End Show
Cont BCD
Valid Combinations
Decimal
BCD
0000
0001
0010
0011
0100
0101
0110
0111
1000
1001
Invalid Combinations
Decimal
BCD
10
1010
11
1011
12
1100
13
1101
14
1110
15
1111
End Show
Cont .BCD
Converting the Decimal value 546 to BCD
5 = 0101
4 = 0100
6 = 0110
Thus 54610 = 0101010001102
End Show
ASCII - The American Standard Code for
Information Interchange
The American National Standards Institute has
published an American Standards Code for
Information Interchange(ASCII)
This code is now most widely used by major
manufactures. so that their equipment will be
compatible with those of other manufactures.
End Show
ASCII is a computer code which uses 128
different coding combinations of a group of seven
bits (27= 128) to represent
Characters A to Z, both upper and lower
case
Special characters, < , ., ?, : ,etc.,
Numbers 0 to 9
Special control codes used in device control
DEC
CHAR
HEX
DEC
CHAR
41
65
61
97
42
66
62
98
43
67
63
99
44
68
64
100
58
End Show
HEX
DEC
CHAR
30
48
31
49
32
50
33
51
34
52
35
53
36
54
88
78
120
37
55
59
89
79
121
38
56
5A
90
7A
122
39
57
End Show
ASCII (Cont)
2.3
End Show
End Show
A logic gate is an elementary building block of a digital circuit.
Most logic gates have two inputs and one output.
At any given moment, every terminal is in one of the two
binary conditions low (0) or high (1), represented by different
voltage levels.
In most logic gates, the low state is approximately zero volts
(0 V), while the high state is approximately five volts positive
(+5 V).
There are seven basic logic gates: AND, OR, XOR, NOT,
NAND, NOR, and XNOR.
End Show
Logic gates are small (several micron)
structures which take one or more bits
as input, and produce another bit as
output
End Show
End Show
AND - Gate
The AND gate has two or more inputs.
The output from the AND gate is 1 if and only if all of the
inputs are 1, otherwise the output from the gate is 0.
The AND gate is drawn as follows
A.B
A
B
F=A.B
End Show
0
0
End Show
0
0
End Show
0
0
End Show
1
0
End Show
1
0
End Show
0
0
End Show
0
1
End Show
0
1
End Show
0
0
End Show
1
1
End Show
1
1
End Show
0
0
B
0
1
0
1
A.B
0
0
0
1
End Show
0
0
0
1
1
0
1
1
F=0
F=0
F=0
F=1
OR-Gate
End Show
A+B
A
B
F=A+B
End Show
0
0
End Show
0
0
End Show
End Show
End Show
1
0
End Show
1
0
End Show
End Show
End Show
0
1
End Show
0
1
End Show
End Show
End Show
1
1
End Show
1
1
End Show
End Show
F=0
0
0
A
0
0
1
1
B
0
1
0
1
A+B
0
1
1
1
F=1
1
1
F=1
0
1
F=1
End Show
NOT-Gate
End Show
A
0
1
1
0
End Show
Transistor
Output from
NOT gate.
End Show
Input to
NOT gate
is ON.
Output from
NOT gate
is OFF.
Transistor
OFF
NOT 1 0
End Show
Input to
NOT gate
is OFF.
Output from
NOT gate
is ON.
Transistor
ON
NOT 0 1
End Show
End Show
End Show
End Show
End Show
End Show
End Show
End Show
NAND-Gate
A
End Show
P A.B
P A.B
0
0
1
1
0
1
0
1
1
1
1
0
End Show
NOR-Gate
A
B
P A B
The truth table for a twoinput NOR gate looks like
A
0
0
1
1
0
1
0
1
1
0
0
0
End Show
XOR-Gate
P A B
A
0
0
1
1
B
0
1
0
1
P
0
1
1
0
End Show
End Show
T1 : Commutative Law
(a) A + B = B + A
A+
B
B+
A
A+
B
B+
A
T2 : Associate Law
End Show
(a) (A + B) + C = A + (B + C)
A
(A+B
)
(A+B)
+C
(B+C
)
A+
(B+C)
End Show
(A.B)
(A.B).C
(B.C)
A.(B.C)
T3 : Distributive Law
End Show
(B+C
)
A.(B+C)
AB
AC
AB+AC
End Show
(b) A + (B.C) = (A + B) (A + C)
A
BC
A+(BC)
(A+B
)
(A+C)
(A+B).
(A+C)
T4 : Identity Law
(a) A + A = A
End Show
A
P=A+A
P=A.A
(b) A.A = A
T5 :(a)
End Show
AB A B A
AB A B
AB
B AB
1
0
End Show
(b) A B . A B A
A B
( A B ).( A B )
0
1
B A+B
T6 : Redundance Law
End Show
(a) A + A.B = A
A
A.B
A+A.B
0
0
1
1
(b) A.(A + B) = A
A
A+
B
A.(A+B)
0
0
1
1
T7 :
End Show
(a) 0 + A = A
0
0+
A
0
1
(b) 0 . A = 0
0
0.A
T8 :
End Show
(a) 1 + A = 1
1
1+
A
1.A
(b) 1 . A = A
T9 : (a)
(b)
A A 1
End Show
A A
A. A 0
A
A. A
T10 :A AB A B
End Show
AB
A AB
A+
B
A.B
A( A B ) AB
A
A B
A( A B )
(a)
End Show
A B A.B
A
A+B
A B
A.B
A.B A B
(b)
A B
A.B
1
A.B
End Show