Chapter 1 Introduction To Computer Organization and Architecture
Chapter 1 Introduction To Computer Organization and Architecture
High-Level Language: D = A * B + 10
Writing assembly programs gives the computer designer the needed deep
understanding of the instruction set and how to design one
To be able to write compilers for HLLs, we need to be expert with the
machine language. Assembly programming provides this experience
Assembly vs. High-Level Languages
Some representative types of applications:
Next …
Assembly-, Machine-, and High-Level Languages
Assembly Language Programming Tools
Programmer’s View of a Computer System
Basic Computer Organization
Assembler
Software tools are needed for editing, assembling, linking, and
debugging assembly language programs
An assembler is a program that converts source-code programs
written in assembly language into object files in machine language
Popular assemblers have emerged over the years for the Intel
family of processors. These include …
TASM (Turbo Assembler from Borland)
Operating System
Level 3
Instruction Set
Architecture Level 2
Microarchitecture Level 1
Each level
Digital Logic hides the
Level 0 details of the
level below it
Programmer's View – 2
Application Programs (Level 5)
Written in high-level programming languages
Such as Java, C++, Pascal, Visual Basic . . .
Programs compile into assembly language level (Level 4)
Assembly Language (Level 4)
Instruction mnemonics are used
Have one-to-one correspondence to machine language
Calls functions written at the operating system level (Level 3)
Programs are translated into machine language (Level 2)
Operating System (Level 3)
Provides services to level 4 and 5 programs
Translated to run at the machine instruction level (Level 2)
Programmer's View – 3
Instruction Set Architecture (Level 2)
Specifies how a processor functions
Machine instructions, registers, and memory are
exposed
Machine language is executed by Level 1
(microarchitecture)
Microarchitecture (Level 1)
Controls the execution of machine instructions (Level 2)
Implemented by digital logic (Level 0)
Digital Logic (Level 0)
Implements the microarchitecture
Uses digital logic gates
Logic gates are implemented using transistors
Instruction Set Architecture (ISA)
In computer science, an instruction set architecture (ISA) is an
abstract model of a computer. It is also referred to as architecture
or computer architecture.
A realization of an ISA, such as a central processing unit (CPU), is
called an implementation.
Collection of assembly/machine instruction set of the machine
Machine resources that can be managed with these instructions
Memory
Programmer-accessible registers.
Provides a hardware/software interface
Cont’d…
The instruction set provides commands to the processor, to tell it what it
needs to do.
The instruction set consists of addressing modes, instructions, native
data types, registers, memory architecture, interrupt, and exception
handling, and external I/O.
An example of an instruction set is the x86 instruction set, which is
common to find on computers today. Different computer processors can
use almost the same instruction set while still having very different
internal design.
Both the Intel Pentium and AMD Athlon processors use nearly the same
x86 instruction set.
An instruction set can be built into the hardware of the processor, or it
can be emulated in software, using an interpreter. The hardware design is
more efficient and faster for running programs than the emulated
software version.
Examples of instruction set
ADD - Add two numbers together.
COMPARE - Compare numbers.
IN - Input information from a device, e.g., keyboard.
JUMP - Jump to designated RAM address.
JUMP IF - Conditional statement that jumps to a designated RAM
address.
LOAD - Load information from RAM to the CPU.
OUT - Output information to device, e.g., monitor.
STORE - Store information to RAM.
Instruction Set Architecture (ISA)
Next …
Welcome
Assembly-, Machine-, and High-Level Languages
Assembly Language Programming Tools
Programmer’s View of a Computer System
Basic Computer Organization
Basic Computer Organization
Since the 1940's, computers have 3 classic
components:
Processor, called also the CPU (Central Processing
Unit)
Memory and Storage Devices
I/O Devices
Interconnected with one or more buses
data bus
ALU CU clock
Control Bus
control bus
address bus
Processor (CPU)
Processor consists of
Datapath
ALU
Registers
Control unit
ALU
Performs arithmetic
and logic instructions
Control unit (CU)
Generates the control signals required to execute instructions
Implementation varies from one processor to another
Clock
Synchronizes Processor and Bus operations
Clock cycle = Clock period = 1 / Clock rate
Address Space is
the set of memory
locations (bytes)
that can be
addressed
CPU Memory Interface
Address Bus
Memory address is put on address bus
If memory address = m bits then 2m locations are addressed
Data Bus: b-bit bi-directional bus
Data can be transferred in both directions on the data bus
Note that b is not necessary equal to w or s. So data transfers might take
more than a single cycle (if w > b) .
Control Bus
Signals control
transfer of data
Read request
Write request
Complete transfer
Memory Devices
Random-Access Memory (RAM)
Usually called the main memory
It can be read and written to
It does not store information permanently (Volatile , when it is powered
off, the stored information are gone)
Information stored in it can be accessed in any order at equal time
periods (hence the name random access)
Information is accessed by an address that specifies the exact
location of the piece of information in the RAM.
DRAM = Dynamic RAM
1-Transistor cell + trench capacitor
Dense but slow, must be refreshed
Typical choice for main memory
SRAM: Static RAM
6-Transistor cell, faster but less dense than DRAM
Typical choice for cache memory
Memory Devices
ROM (Read-Only-Memory)
A read-only-memory, non-volatile i.e. stores information permanently
Has random access of stored information
Used to store the information required to startup the computer
Many types: Masked ROM, PROM, EPROM, EEPROM, and FLASH
FLASH memory can be erased electrically in blocks
Cache
A very fast type of RAM that is used to store information that is most
frequently or recently used by the computer
Recent computers have 3-levels of cache; the first level is faster but smaller in
size (usually called internal cache), and the second level is slower but larger
in size (external cache).
Processor-Memory Performance Gap
CPU: 55% per year
1000
“Moore’s Law”
Performance
100
Processor-Memory
Performance Gap:
(grows 50% per year)
10
2000
1980 – No cache in microprocessor
1995 – Two-level cache on microprocessor
The Need for a Memory Hierarchy
Widening (expand) speed gap between CPU and main memory
Processor operation takes less than 1 ns
Bigger
Faster
Main Memory (1 – 2 GB) Memory Bus
Access time: 50 – 70 ns Memory
Disk Storage (> 200 GB)
I/O Bus
Access time: milliseconds
Disk, Tape, etc
Magnetic Disk Storage
Disk Access Time =
Seek Time +
Rotation Latency +
Transfer Time
Sector
Read/write head
Actuator
Recording area
Track 2
Seek Time: head movement to the Track 1
Track 0