Computer Architecture
Aamna Tariq
Amna.tariq@students.au.edu.pk
Air University Islamabad
Digital Logic Level
➢ The computer’s real hardware.
• Basic elements: gates
• Basic logic: Boolean algebra
• Combinatorial Circuits
• Arithmetic Circuits
• Memory
• CPUs and buses
Basic Gates: Logic
NOT NAND NOR AND OR
A A A A
A X X X X X
B B B B
A X A B X A B X A B X A B X
0 1 0 0 1 0 0 1 0 0 0 0 0 0
1 0 0 1 1 0 1 0 0 1 0 0 1 1
1 0 1 1 0 0 1 0 0 1 0 1
1 1 0 1 1 0 1 1 1 1 1 1
(a) (b) (c) (d) (e)
Most computers are based on NAND and NOR gates.
Boolean Algebra
A B C AB C
A
Algebra of boolean functions. 1
A
•Inputs and results are logical values. 4
ABC
• Boolean function of n variables has 2n
input combinations. ABC
5
• Representation by truth table with 2n
B
2
8
rows. . B
M
A B C M
6
0 0 0 0 ABC
0 0 1 0 C
0 1 0 0
3
0 1 1 1 C
ABC
1 0 0 0 7
1 0 1 1
1 1 0 1 (b)
1 1 1 1
(a)
The Microarchitecture Level
• The level above the digital logic level is the
microarchitecture level.
• Its job is to implement the ISA (Instruction Set
Architecture) level above it.
• The design of the microarchitecture level depends on the ISA
being implemented, as well as the cost and performance goals
of the computer.
• Many modern ISAs (particularly RISC) have simple instructions
that execute in acycle.
The Microarchitecture Level
• More complex ISAs require many cycles per instruction
• Executing the instruction may require:
• locating the operands in memory
• reading them
• storing the results back into memory
• The sequencing of operations within a single instruction
often leads to a different approachto control than for
simpleISAs
Instruction Set Architecture(ISA)
Application (iTunes)
Operating
software
Compiler System
Assembler (Mac OS X)
instruction set
Processor Memory I/O system
Datapath & Control
hardware Digital Design
Circuit Design
Transistors
7
Instruction Set Architecture(ISA)
• To command a computer ‘s hardware, you must speak its language
• The words of a machine's language are called instructions, and its
vocabulary is called instruction set
• The complete collection of instructions that are understood by a CPU
• Once you learn one machine language, it is easy to pick up others:
• There are few fundamental operations that all computers must provide
• All designer have the same goal of finding a language that simplifies building
the hardware and the compiler while maximizing performance and minimizing
cost
• Learning how instructions are represented leads to discovering the
secret of computing: “the stored-program concept”
What is instruction set architecture (ISA)?
• What is instruction set architecture (ISA)?
• ISA
• Defines registers
• Defines data transfer modes (instructions) between
registers, memory and I/O
• There should be sufficient instructions to efficiently
translate any program for machine processing
• Next, define instruction set format – binary
representation used by the hardware
• Variable-length vs. fixed-length instructions
Types of ISA
• Complex instruction set computer (CISC)
• Many instructions (several hundreds)
• An instruction takes many cycles to execute
• Example: Intel Pentium
• Reduced instruction set computer (RISC)
• Small set of instructions
• Simple instructions, each executes in one clock cycle
• Effective use of pipelining
• Example: ARM