Download as ppt, pdf, or txt
Download as ppt, pdf, or txt
You are on page 1of 79

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

Chapter 5A : Transforming Data into Information


5A-2
How Computers Represent Data
• Number systems
– A manner of counting
– Several different number systems exist
• Decimal
• Binary
• Octal
• Hexadecimal…. Example : 462
• Decimal number system
– Used by humans to count 4100th 610th 21th
– Contains ten distinct digits
– Digits combine to make larger numbers
– Value depends on position and power of 10
Chapter 5A : Transforming Data into Information
5A-3
How Computers Represent Data
• Binary number system
– Used by computers to count
– Two distinct digits, 0 and 1
– 0 and 1 combine to make numbers
– Value depends on position and power of 2

10101
MSB LSB

1x24+0x23+1x22+0x21+1x20

Chapter 5A : Transforming Data into Information


5A-4
How Computers Represent Data
Conversion
–Binary to Decimal
–Decimal to Binary
–Decimal to Octal
–Decimal to Hexadecimal
–Decimal to Binary to Hexadecimal

Chapter 5A : Transforming Data into Information


5A-5
How Computers Represent Data
Conversion
–Binary to Decimal

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

Chapter 5A : Transforming Data into Information


How Computers Represent Data
Binary Number Addition
A B C= Carry
A+B
0 0 0 0
0 1 1 0
1 0 1 0
1 1 0 1

Chapter 5A : Transforming Data into Information


5A-11
How Computers Represent Data
Binary number subtraction

A B C= A-B Borrow
0 0 0
0 1 1 1
1 0 1
1 1 0

Chapter 5A : Transforming Data into Information


5A-12
How Computers Represent Data
Binary number Multiplication

A B C= A*B
0 0 0
0 1 0
1 0 0
1 1 1

Chapter 5A : Transforming Data into Information


5A-13
How Computers Represent Data
Binary number Division

A B C= A/B
0 0 error
0 1 0
1 0 error
1 1 1

Chapter 5A : Transforming Data into Information


5A-14
Binary Addition
Example : add binary number 1011112 and 101112

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

Example : Subtract binary number 10102 and 1012

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

3x162 + 14x 161 + 7x160


768 + 224 + 7 = 99910

Chapter 5A : Transforming Data into Information


Example
3B6E 16

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

Chapter 5A : Transforming Data into Information


5A-23
Boolean Algebra

• Digital Circuit in a digital computer use


Boolean algebra for mathematical operation
• Describe relationship between the inputs and
outputs of a digital circuit
• Used mainly by engineers to obtain required
output using least number of logic gates
• Boolean variables are “true” or “false” or as
‘1’ or “0”

Chapter 5A : Transforming Data into Information


5A-24
Boolean Algebra

• Three basic Operations of Boolean Algebra


are:
A AND B = A.B
A OR B = A+B
A NOT =A

Chapter 5A : Transforming Data into Information


5A-25
AND
• In order for current to flow, both switches must
be closed
– Logic notation AB = C
(Sometimes AB = C)

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 QA

0 1
Logic: QA
1 0
NAND (NOT AND)

NAND
S  AB 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
SAB 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)

Either A or B, but not both


A B S
This is sometimes called the
inequality detector, because the 0 0 0
result will be 0 when the inputs are the 1 0 1
same and 1 when they are different.
0 1 1
The truth table is the same as for 1 1 0
S on Binary Addition. S = A + B
Half Adder

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

• VBB voltage controls whether the transistor


conducts in a common base configuration.

• Logic circuits can be built


Chapter 5A : Transforming Data into Information
How Computers Process Data
Text codes
– Converts letters into binary (keyboard)
– Standard codes necessary for data transfer
– EBCDIC –Extended Binary Coded Decimal Interchange
Code- 8-bit (1 byte) 28 =256 symbols, IBM Mainframe
– ASCII
• American Standard Code for Information Interchange –
8-bit, from value 0-127 codes
– Extended ASCII
• Graphics and other symbols, 8-bit from 128 to 255 for special
punctuation and graphic symbols
– Unicode - All languages on the planet, 32-bit, 4 billion
different characters, Compatibility with ASCII code
Chapter 5A : Transforming Data into Information
5A-37
How Computers Process Data
Example of ASCII Text Codes
ASCII Code Decimal Character
Value
0000 1000 8 Backspace
0010 0101 37 %
0010 1011 43 +
0100 0000 64 @
0100 0001 65 A
0110 0001 97 a
0011 0001 49 1
01100111 103 g

Chapter 5A : Transforming Data into Information


5A-38
How Computers Process Data
• Two components handle processing in a
computer
– The Central Processing Unit (CPU)
– Memory (RAM)
• Bothe are located on computer
motherboard

Chapter 5A : Transforming Data into Information


5A-39
How Computers Process Data

RAM
Processor

Chapter 5A : Transforming Data into Information


5A-40
PC Motherboard

Chapter 5A : Transforming Data into Information


5A-41
PC Motherboard

Chapter 5A : Transforming Data into Information


5A-42
PC Motherboard

Chapter 5A : Transforming Data into Information


5A-43
How Computers Process Data
• The CPU
– Central Processing Unit
– Brain of the computer
– Control Unit
• Controls/manages resources in computer
• Instruction set built into Control Unit
• The logical hub of computer
– Arithmetic Logic Unit (ALU)
• Simple math ( Add, Subtract, multiplication and
division) and Logical operations
• Registers – kind of memory to hold data
currently being processed
Chapter 5A : Transforming Data into Information
5A-44
CPU

Chapter 5A : Transforming Data into Information


5A-45
CPU

Chapter 5A : Transforming Data into Information


5A-46
How Computers Process Data
Operations performed by Arithmetic Logic
Unit (ALU)
Arithmetic Operation Logical Operation

+ Add =, ≠. Equal to, Not equal to

- Subtract ˃, ˃ Greater then, Not


greater than

x Multiply ˂,˂ Less than, not less than

÷ Divide ˃=, ˃= Greater than or equal


to, not greater than or equal
to
Ʌ
Raise by power ˂=, ˂= Less than or equal to,
5A-47 not less than
Chapter or equal Data
5A : Transforming to into Information
How Computers Process Data
• Machine cycles- Completed series of steps by
CPU to execute an instruction for processing data
– Instruction cycle- CPU gets the instruction
• Fetching (retrieving a command or data from RAM)
• Decoding (breaking the command into instruction set)
– Execution cycle- CPU performs the instruction
• Executing ( carries out instructions by converting into microcode)
• Storing ( storing result in memory when needed)

– CPU can translate billions of Instructions per second


(BIPS)
– Pipelining processes execute instruction rapidly
– Multitasking allows multiple instructions by creating
threads
Chapter 5A : Transforming Data into Information
5A-48
Machine cycles

5A-49
Machine cycles

5A-50
How Computers Process Data
– Pipelining
– Threading
– Multi-Threading
– Hyperthreading
processes more data and perform
operation rapidly

Chapter 5A : Transforming Data into Information


5A-51
How Computers Process Data
• Memory
– Stores and retrieve programs (set of instructions)
and data while they are being used
– Small chips on the motherboard
– More memory makes a computer faster

Chapter 5A : Transforming Data into Information


5A-52
How Computers Process Data
• Memory

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

Chapter 5A : Transforming Data into Information


5A-55
How Computers Process Data
• Flash memory
– Data is stored using physical switches
– Special form of nonvolatile memory
– Camera cards, USB key chains

Chapter 5A : Transforming Data into Information


5A-56
How Computers Process Data
• Volatile memory (RAM)
– Random Access Memory (RAM)
– Holds program and data while they are in
use
– Requires power to hold data and program
– Data in RAM has an address
– CPU reads and writes data using the
address
– CPU can read any address

Chapter 5A : Transforming Data into Information


5A-57
How Computers Process Data
• Volatile memory (RAM)
– SRAM (Static RAM) –Cache Memory
– DRAM (Dynamic RAM)
– SD RAM (Synchronous Dynamic RAM)
– RD RAM (Rambus Dynamic RAM)
– DDR SD RAM (Double Data Rate SD
RAM1/2/3) up to 4800 MHz
– SIMM, DIMM(Dual In-line Memory Module)
and RIMM(Rambus In-line Memory Module)
available
Chapter 5A : Transforming Data into Information
5A-58
Factors Affecting Processing Speed

• 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

Chapter 5A : Transforming Data into Information


5A-59
Factors Affecting Processing Speed
• Registers
– Number of bits processor can handle
– Word size- 16 bit, 32 bit , 64 bit…
32 bit processor mean the CPU with 32 bit
register
– Larger indicates more powerful computer
– Increase by purchasing new CPU

Chapter 5A : Transforming Data into Information


5A-60
Components affecting Speed

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

Chapter 5A : Transforming Data into Information


5A-62
Factors Affecting Processing Speed
The computer’s Internal Clock
– Computer’s operating speed closely tied
with speed of the Internal system clock
– Quartz crystal
– Every tick causes a cycle
– Speeds measured in Hertz (Hz)
• Modern machines use Giga Hertz (GHz)

Chapter 5A : Transforming Data into Information


5A-63
Factors Affecting Processing Speed
• The bus
– Electronic pathway between components
– Two main Buses
• Internal/System Bus
– Data Bus
– Address Bus
• External (Expansion) Bus
– Expansion bus connects to peripherals
– System bus connects CPU and RAM
– Bus width is measured in bits, 16-bit, 32-bit,
64–bit…
– Speed is tied to the clock
Chapter 5A : Transforming Data into Information
5A-64
Factors Affecting Processing Speed
• Type of bus
– External (or expansion) – connects external devices
– Internal (or system) bus –resides in the motherboard
• The Data Bus –connects CPU with Memory and other
hardware
• The Address Bus – connects CPU only with RAM
• Control Bus

Chapter 5A : Transforming Data into Information


5A-65
Factors Affecting Processing Speed
• Type of bus

Chapter 5A : Transforming Data into Information


5A-66
Factors Affecting Processing Speed
• External bus standards
– Industry Standard Architecture (ISA)
– Local bus
– Peripheral Component Interconnect(PCI)
– Accelerated graphics port(AGP)
– Universal serial bus(USB)
– IEEE 1394 (FireWire)
– PC Card

Chapter 5A : Transforming Data into Information


5A-67
Factors Affecting Processing Speed
Industry Standard Architecture (ISA)
– 16-bit data bus
– industry standard released in 1980s
– Used to attach slower devices like modem
and input devices

Chapter 5A : Transforming Data into Information


5A-68
Factors Affecting Processing Speed
Local bus
– Internal system bus to connect component
in the motherboard
– Attach faster devices

Chapter 5A : Transforming Data into Information


5A-69
Factors Affecting Processing Speed
• Peripheral Component
Interconnect(PCI)
– Connects modems and audio, video and
graphics
– Found in most modern computers

Chapter 5A : Transforming Data into Information


5A-70
Factors Affecting Processing Speed
• Accelerated Graphics Port (AGP)
– Connects video card to motherboard
– Extremely fast bus
– Found in all modern computers

Chapter 5A : Transforming Data into Information


5A-71
Factors Affecting Processing Speed
• Universal Serial Bus (USB)
– Connects external devices
– Hot swappable
– Allows up to 127 devices
– Cameras, printers, and scanners

Chapter 5A : Transforming Data into Information


5A-72
Factors Affecting Processing Speed
• IEEE1394(FireWire)
– Used in Macintosh and IBM computers
– Connect Video devices like camera and
video cameras
– Many digital TV connections also use
FireWire

Chapter 5A : Transforming Data into Information


5A-73
Affecting Processing Speed
• PC Card
– Used on laptops
– Hot swappable
– Devices are the size of a credit card

Chapter 5A : Transforming Data into Information


5A-74
Affecting Processing Speed
• Cache memory
– Very fast memory having tremendous
impact on computer’s speed
– Holds common or recently used data
– Speeds up computer processing
– Most computers have several caches
– L1 holds recently used data
– L2 holds upcoming data
– L3 holds possible upcoming data

Chapter 5A : Transforming Data into Information


5A-75
Chapter Summery
• Number System- Decimal, Binary, Hexadecimal
• Conversion of Number System- Decimal to
Binary, Binary to Decimal, Hexadecimal to binary, Binary to
Hexadecimal, Decimal to Hexadecimal
• Binary Arithmetic- Addition, Subtraction,
Multiplication, Division
• Boolean Algebra- AND, OR, NAND, NOR , XOR, NOT truth table
• Text Code - EBCDIC,ASCII, Unicode
• How Computer Process data - Role of CPU,
Memory, ALU, Register,
• Factors affecting Processing Speed-
Processor, RAM, Clock, BUS, Cashe
Chapter 5A : Transforming Data into Information
5A-76
Chapter 5A

End of Chapter

McGraw-Hill Technology Education Copyright © 2006 by The McGraw-Hill Companies, Inc. All rights reserved.
CPU

Chapter 5A : Transforming Data into Information


5A-78
Components affecting Speed

5A-79

You might also like