Lecture Week 03
Lecture Week 03
Introduction to Computing
Lecture 3: Computer architecture
Dr Malcolm Clarke
1.0
Lecture Outline
• What is computer architecture
• What is machine language
• What are arithmetic/logic
instructions
• How programs are executed
• How to communicate with other
devices
2
Learning Outcomes
After this lecture you will be able to
• understand the concepts of
– Computer architecture
– Machine language
– Arithmetic/Logic Instructions
• have an idea how a program is actually
executed
3
Review: Bits and Bit Patterns
• Bit: Binary Digit (0 or 1)
• Bit Patterns are used to represent
information.
– Numbers
– Text characters
– Images
– Sound
– And others
0-4 4
Review: Boolean Operations
• Boolean Operation: An operation that
manipulates one or more true/false
values
• Specific operations
– AND
– OR
– XOR (exclusive or)
– NOT
0-5 5
Review: The Boolean operations AND, OR,
and XOR (exclusive or)
0-6 6
Review: Gates and a pictorial representation
• Gate: A device that
computes a Boolean
operation
– Often
implemented as
(small) electronic
circuits
– Provide the
building blocks
from which
computers are
constructed
– VLSI (Very Large
Scale Integration)
0-7 7
Review: Hexadecimal notation and
the hexadecimal coding system
• Hexadecimal
notation:
– A shorthand
notation for long
bit patterns
– Divides a pattern
into groups of four
bits each
– Represents each
group by a single
symbol
• Example: 10100011
becomes A3
0-8 8
Review: Memory cells arranged
by address
0-9 9
Computer Architecture
• Central Processing Unit (CPU) or
processor
– Control unit
– Arithmetic/Logic unit (ALU)
– Registers
• General purpose
• Special purpose
• Bus
• Motherboard
0-10 10
CPU and main memory
connected via a bus
0-11 11
Stored Program Concept and
terminologies
• All computers are based on Machine instruction: An instruction
the ideas of John von (or command) encoded as a bit
Neumann and Alan Turing pattern recognizable by the CPU.
in 1945 The types include
• A program can be encoded ‐ Data Transfer: copy data from one
as bit patterns and stored location to another
in main memory. ‐ Arithmetic/Logic: use existing bit
• From there, the CPU can patterns to compute a new bit
then extract the patterns
instructions and execute ‐ Control: direct the execution of
them. the program
• In turn, the program to be Machine language: The set of all
executed can be altered instructions recognized by a
easily. machine
0-12 12
Example: Add two values stored in memory
0-13 13
Machine Instruction
• Op-code: Specifies which operation to execute
• Operand: Gives more detailed information about
the operation
– Interpretation of operand varies
– depending on op-code
0-15 15
Decoding the instruction 35A7
0-16 16
An encoded version of the
instructions for addition
0-17 17
Program Execution
• Controlled by two special-purpose
registers
– Program counter: address of next
instruction
– Instruction register: current instruction
• Machine Cycle
– Fetch
– Decode
– Execute
0-18 18
The machine cycle
0-19 19
The “addition” program stored in main
memory ready for execution
0-20 20
Performing the fetch step of the
machine cycle: I
0-21 21
Performing the fetch step of
the machine cycle: II
0-22 22
Communication with other devices:
controllers attached to a machine’s bus
0-23 23
Communicating with other devices:
types and data communication rates
• Parallel Communication: Several communication
paths transfer bits simultaneously.
• Serial Communication: Bits are transferred one
after the other over a single communication path.
• Measurement units
– Bps: Bits per second
– Kbps: Kilo-bps (1,000 bps)
– Mbps: Mega-bps (1,000,000 bps)
– Gbps: Giga-bps (1,000,000,000 bps)
• Bandwidth: Maximum available rate
0-24 24
Other Architectures
• Technologies to increase throughput:
– Pipelining: Overlap steps of the machine
cycle
– Parallel Processing: Use multiple
processors simultaneously (I: instruction,
D: data)
• SISD: No parallel processing
• MIMD: Different programs, different data
• SIMD: Same program, different data
0-25 25
Next Lecture
26