Professional Documents
Culture Documents
Chapter 5A: Transforming Data Into Information
Chapter 5A: Transforming Data Into Information
McGraw-Hill Technology Education Copyright © 2006 by The McGraw-Hill Companies, Inc. All rights reserved.
Chapter Outlines
• Number System
• Conversion of Number System
• Binary Arithmetic
• Boolean Algebra
• Text Code
• How Computer Process data
• Factors affecting Processing Speed
10101
MSB LSB
1x24+0x23+1x22+0x21+1x20
10101
MSB LSB
1x24+0x23+1x22+0x21+1x20
16 + 0 + 4 + 0 + 1 = 21
101012 = 2110
Chapter 5A : Transforming Data into Information
5A-6
Binary (base 2) {0 1}
Binary Decimal
0000 0
0001 1
0010 2
0011 3
0100 4
0101 5
0110 6
0111 7
1000 8
1001 9
1010 10
1011 11
1100 12
1101 13
1110 14
1111 15
Conversion : Binary to Decimal
MSB LSB
11011001
• 1101 1001 Notice how powers of two
1 X 27 = 128 stand out:
+ 1 X 26 = 64 20 = 0001
+ 0 X 25 = 0
21 = 0010
+ 1 X 24 = 16
+ 1 X 23 = 8 22 = 0100
+ 0 X 22 = 0 23 = 1000
+ 0 X 21 = 0
+ 1 X 20 = 1
217
Chapter 5A : Transforming Data into Information
How Computers Represent Data
Conversion
–Binary to Decimal
2048 1024 512 256 128 64 32 16 8 4 2 1
1x211 1x210 1x29 1x28 1x27 1x26 1x25 1x24 1x23 1x22 1x21 1x20
1 1 1 1 1 1 1 1 1 1 1 1
0 0 512 0 0 0 32 0 0 4 0 1
1x211 1x210 1x29 1x28 1x27 1x26 1x25 1x24 1x23 1x22 1x21 1x20
0 0 1 0 0 0 1 0 0 1 0 1
Chapter 5A : Transforming Data into Information
5A-9
Decimal to Binary Conversion
A B C= A-B Borrow
0 0 0
0 1 1 1
1 0 1
1 1 0
A B C= A*B
0 0 0
0 1 0
1 0 0
1 1 1
A B C= A/B
0 0 error
0 1 0
1 0 error
1 1 1
Carry Bits
1 1 1 1 1
1 0 1 1 1 1 47
+ 1 0 1 1 1 23
1 0 0 0 1 1 0 70
Binary Subtraction
borrow Bits
1 1
0 1 0 1
1 0 1 0 10
05
05
- 0 1 0 1
1 0 1
Binary Multiplication
Example : add binary number 10102 and 1012
Carry Bits
1 0 1 0 10
x 1 0 1 05
1 0 1 0
0 0 0 0 X
1 0 1 0 X
50
1 1 0 0 1 0
Hexadecimal (base 16)
• {0 1 2 3 4 5 6 7 8 9 A B C D E F}
• Assignments
Dec Hex Dec Hex
0 0 8 8
1 1 9 9
2 2 10 A
3 3 11 B
4 4 12 C
5 5 13 D
6 6 14 E
7 7 15 F
Decimal to Hexa Conversion
Quotient Reminder
999/16 62 7
62/16 3 14= E
3/16 0 3
99910 = 3E716
163 160
162 161
3 X163 = 12288
+ 11 X162 = 2816
15214 10
+ 6 X16 =1
96
+ 14 X160 = 14
Decimal to Binary to Hexa Conversion
999/2 499 1
499/2 249 1
249/2 124 1
124/2 62 0
62/2 31 0
31/2 15 1
15/2 7 1
7/2 3 1
3/2 1 1
1/2 0 1
•Group binary number by fours (nibbles)
– 0011 1110 0111
•Convert each nibble into hex equivalent
– 0011 1110 0111
3 E 7 3E7 16
Chapter 5A : Transforming Data into Information
Hexadecimal is Convenient for
Binary Conversion
Binary Hex Binary Hex
0000 0 1001 9
0001 1 1010 A
0010 2 1011 B
0011 3 1100 C
0100 4 1101 D
0101 5 1110 E
0110 6 1111 F
0111 7 1 0000 10
1000 8 Nibble
How Computers Represent Data
• Bits and bytes
– Binary numbers are made of bits
– Bit represents a switch
– A byte is 8 bits
– Byte represents one character
C=
A B
A.B
0 0 0
0 1 0
1 0 0
1 1 1
OR
• Current flows if either switch is closed
– Logic notation A + B = C
C=
A B
A+B
0 0 0
0 1 1
1 0 1
1 1 1
Inversion (NOT)
A QA
0 1
Logic: QA
1 0
NAND (NOT AND)
NAND
S AB A B S
AND
0 0 1
A B
C= 0 1 1
A.B
0 0 0
1 0 1
0 1 0 1 1 0
1 0 0
1 1 1
NOR (NOT OR)
NOR
SAB A B S
OR
C=
0 0 1
A B
A+B 0 1 0
0 0 0
0 1 1
1 0 0
1 0 1 1 1 0
1 1 1
Exclusive OR (XOR)
Called a half adder because we haven’t allowed for any carry bit
on input. In elementary addition of numbers, we always need to
allow for a carry from one column to the next.
18 01
25 01
43 10
4 ( 3 plus a carry 1) 1 ( 0 plus a carry 1)
Full Adder Circuit
Chaining the Full Adder
Possible to use the same
scheme for subtraction by
noting that
A – B = A + (-B)
Chaining the Full Adder
Transistors as Switches
RAM
Processor
5A-49
Machine cycles
5A-50
How Computers Process Data
– Pipelining
– Threading
– Multi-Threading
– Hyperthreading
processes more data and perform
operation rapidly
5A-53
Flash Memory Chapter 5A : Transforming Data into Information
How Computers Process Data
5A-54
How Computers Process Data
• Nonvolatile memory (ROM)
– Holds data when power is off
– Read Only Memory (ROM)
– Basic Input Output System (BIOS)
– Power On Self Test (POST)
– PROM, EPROM Available
• Size(Bit) of Registers
• Amount of Memory(RAM)
• Speed of Computer’s Internal Clock
• Width (bit) and Speed of the Bus
• Availability and type of Cash Memory
5A-61
Factors Affecting Processing Speed
RAM
• The amount of RAM have profound
effect on computer’s power
• Virtual RAM
– Computer is out of actual RAM
– File that emulates RAM
– Computer swaps data to virtual RAM
• Least recently used data is moved
End of Chapter
McGraw-Hill Technology Education Copyright © 2006 by The McGraw-Hill Companies, Inc. All rights reserved.
CPU
5A-79