Chapter 2 - Computer Architecture
Chapter 2 - Computer Architecture
COMPUTER
ARCHITECTURE
How Computers Represent
Data
■ All symbols, pictures or words must be
reduced to a string of binary digits.
■ A binary digit is called a bit and represents
either a 0 or a 1.
■ These are the only digits in the binary or base
2, number system used by computers.
■ A string of eight bits used to store one number
or character in a computer system is called a
byte.
How Computers Represent Data
(cont.)
One byte for character A 01000001
01000001 A
01001100 L
01001001 I
01000011 C
01000101 E
How Computers Represent Data (cont.)
■ To represent the numbers 0 through 9 and the
letters a through z and A through Z, computer
designers have created coding systems
consisting of several hundred standard
codes.
■ In one code, for instance, the binary number
01000001 stands for the letter A.
Coding Schemes
■ Map a set of alphanumeric characters (letters
and numbers) and special symbols to a
sequence of numeric values that a computer
can process.
■ ASCII (pronounced ASK-ee), which stands
for American Standard Code for
Information Interchange, is the most
widely used coding scheme to represent a set
of characters.
Coding Schemes (cont.)
Eight bits grouped together as a unit are called a
byte. A byte represents a single character in the
computer or mobile device.
Data Representation
■ How is a letter converted to binary form and back?
Step 1.
The user presses Step 2.
the capital letter An electronic signal for the
D (shift+D key) capital letter D is sent to the
on the keyboard. system unit.
Step 3.
The signal for the capital letter D
is converted to its ASCII binary
Step 4.
code (01000100) and is stored in
After processing, the binary
memory for processing.
code for the capital letter D is
converted to an image, and
displayed on the output device.
The System Unit
■ A case that contains a computer’s main system components,
including the processor, memory, and the computer’s main
circuit board.
power supply drive bays
Processor processor
Memory
Adapter cards ports memory
Sound card
Video card
Power supply
Main circuit
board in system
unit
Contains adapter
cards, processor
chips, and
memory chips
Also called
system board
The System Unit
1
0
■ The CPU
– manipulates raw data into more useful
form and controls the other parts of the
computer system.
■ Primary storage (RAM)
– temporarily stores data and program
instructions during processing.
■ Secondary storage (Hard Drive)
– devices store data and programs when they
are not being used in processing.
■ Communication devices
– provide connections between the computer
and communications networks.
Computer Components
• Input/output units
• Memory/storage units
• CPU (Central Processing Unit)
Connection of
Components
The CPU
■ The Central Processing Unit
• What is the CPU?
• The Microprocessor
• Structure of the CPU
• Parts of the CPU
1. Buses
2. The Control Unit
3. The Arithmetic Logic Unit
4. Program counter
5. Instruction Register
What is the CPU?
Control Unit
Input Program Counter Output
Unit Unit
Instruction Register
Central Memory
ROM
RAM
Control Bus
Data Bus Backing
Storage
Buses
■ All data traffic with the CPU
takes place across the
computer’s bus
■ A computer bus is a set of
parallel electrical tracks
connecting components within
a computer
■ The width of the data bus
determines the word length
■ The width of the address bus
determines how many
addresses the computer can
send at a time
Control Unit (CU)
■ The CU is considered the manager of the CPU
■ The CU’s jobs are to;
1. decode instructions within a computer,
2. Plan the reading and writing of data
3. control the order in which instructions are executed
4. control the operations performed by the ALU.
■ In the CU you will fine two registers;
1. Instruction Register: stores a copy of the current
instruction being performed
2. Program Counter.
The Arithmetic Logic Unit (ALU)
■ The ALU is that part in the CPU where arithmetic and logic
operations are carried out in other words all mathematical
calculations. The result of the calculations are sent to the main
memory
■ The ALU is capable of performing:
1. Addition, Subtraction, Multiplication, Division
2. Greater Than (>), Smaller Than (<)’ Equal (=),Greater
Than or Equal To (>=), Smaller Than or Equal To (<=),
Not Equal (<>)
3. AND, NOT, OR
■ Within the ALU we will find the register known as the
Accumulator. The accumulator stores the result of the current
calculation.
Program Counter (PC)
■ The program counter is sometimes known as the
instruction pointer
■ The PC indicates where the computer is in its
instruction set. If the instruction set has 5 steps the
PC will point to which step the computer has arrived
■ Depending on the device the PC could hold
1. The address of the instruction being executed, or
2. The address of the next instruction to be
executed.
■ The program counter is automatically incremented
(increased by 1) after each step (instruction cycle)
Instruction Register (IR)
■ The instruction register (IR) is also found with
the control unit
■ The IR is used to store a copy of the current
instruction being performed
■ This instruction is stored in the front of
operator and operand.
Machine Cycle
• Fetch-decode-execute-store
1
1
Main Memory
■ The main memory is where most of the results are
temporarily stored;
■ Main memory is much faster than the hard disk this is
why it is used
■ Each result is stored in a location in the main memory and
each location has an address, this way the CPU can store
and retrieve information which is stored in the main
memory easily and faster
■ When the CPU writes information to the main memory
two things are supplied
1. the address section: passes through the address bus
2. the data section:
passes through the data bus
Random Access
•Memory
Alternatively referred to as main
memory, primary memory, or system
memory
• Allows information to be stored and
retrieved on a computer.
• RAM is a volatile memory and requires
power to keep the data accessible.
• If the computer is turned off, all data
contained in RAM is lost.
Read Only
• Memory
Non-volatile memory to hold software that is not
expected to change over the life of the system
• Magnetic core memory
• EEPROM
• Electrically Erasable Programmable ROM
• Slower and less flexible than Flash ROM
• Flash ROM
• Faster than disks but
more expensive
• BIOS: initial boot
instructions and
diagnostics
CMOS Memory
• CMOS (Complimentary Metal Oxide
Semiconductor)
• Memory chip that houses setting
configuration, powered by onboard
battery.
31
Tutorial:
■ Question 1:
– Explain how computer represent
data. (3 marks)
■ Question 2:
– List and explain FOUR (4)
components in the system unit.
(8 marks)