Professional Documents
Culture Documents
sg/~cs1104
Lecture 1: Introduction
CS1104-P2-1
Computer Organisation/Architecture Machine Organisation Buses Instruction Set Architecture (ISA) Questions Clock Cycles Central Processing Unit (CPU)
Introduction
Lecture 1: Introduction
Code Execution Memory
CS1104-P2-1
Introduction
Computer Organisation/Architecture
CS1104-P2-1
CS1104-P2-1
Machine Organisation
von Neumann architecture: Programs and
data are stored in memory (stored-memory concept). Consists of processor, memory and devices. Data are carried along buses between components.
CS1104-P2-1
Introduction
Processor
Control
Memory
Devices
Input
Cache Datapath
Output Registers
CS1104-P2-1 Introduction 7
Buses
Bus: A communication path between
components. Data bus, control bus, address bus. Bus width: the number of lines (bits). Data bus width usually coincides with word size, which is also usually the register size. Address bus width determines the addressable address range. A n-bit address bus can address up to 2n locations.
Introduction 8
CS1104-P2-1
Operating System
Compiler Processor Firmware Instruction Set Architecture I/O system
PART 1
Electrical Engineering
10
CS1104-P2-1
Introduction
CS1104-P2-1
Introduction
11
CS1104-P2-1
Introduction
12
Questions
1) Computer architecture is a study of
a) b) c) d) e) instruction set architecture only. programming language only. machine organisation only. (a) and (c) [Answer] (a), (b) and (c)
2)
CS1104-P2-1
Questions (2)
3) Which of the following does not belong to the definition of an ISA?
a) b) c) d) e) Instruction formats and types. Compilation of a C program into machine code. [Answer] Encoding and representation of data in memory. Modes of addressing and accessing data in memory. None of the above. Hardware implementation of machine organization is part of the instruction set architecture definition. Instruction set architecture is an interface between the assembly language and the machine language. A Pentium II processor running at 450 MHz & a Pentium II processor running at 500 MHz have the same ISA. [Ans] Computer architecture is a subset of the instruction set architecture. None of the above.
Introduction 14
4)
c)
d) e)
CS1104-P2-1
Questions (3)
5) Which of the following statements is true about ISA?
a) b) c) d) e) If two machines can read and understand the same piece of memory data, they must have the same ISA. If two machines have the same ISA, they must have the same performance. In general, executable codes for one ISA cannot be run on another, different ISA. [Answer] The ISA of a processor defines the hardware implementation of the processor. None of the above. Changing the hardware machine organisation will definitely change the instruction set architecture (ISA). [False]
CS1104-P2-1 Introduction 15
6)
Questions (4)
7) Which of the following can be considered as part of the ISA design?
a) b) c) d) e) Specification of high level languages such as JAVA or C. Compiler that translates high level language programs into machine language codes. Machine instruction types such as ADD or LOAD. Data accessing method by the processor. Implementation of hardware functional units in the processor.
CS1104-P2-1
Introduction
16
Clock Cycles
A synchronous system is synchronised
according to a clock.
Rising edge
R = A op B
select ALU R
CS1104-P2-1 Introduction 19
n-bits operations
PC (program counter) ACC (accumulator) IR (instruction register) MAR (memory address register) MBR (memory buffer register) or MDR (memory data register)
Introduction 20
Code Execution
Program in High-level language (C, Pascal, etc) Compile program into assembly language Link multiple machine-language programs to one program Load program into computers memory
Execute program
CS1104-P2-1
Introduction
21
Instruction
Decode
Operand
Fetch Execute Result Store Next
CS1104-P2-1
Introduction
Instruction
22
Memory
Memory stores programs and data. Definitions:
between main memory and registers, usually size of register. 1 KB (kilo-bytes) = 210 bytes; 1 MB (mega-bytes) = 220 bytes; 1 GB (giga-bytes) = 230 bytes; 1TB (tera-bytes) = 240 bytes.
capacity, economical cost, non-volatile. However, most memory devices do not possess all these properties.
Introduction 23
CS1104-P2-1
Memory (2)
Memory hierarchy:
Fast, expensive (small numbers), volatile registers main memory disk storage magnetic tapes
CS1104-P2-1
Introduction
24
Memory (3)
Data transfer:
Processor
MAR
n-bit data bus
Up to 2k addressable locations.
Address
0 1 2 3 4 5
Memory
MDR :
CS1104-P2-1
Introduction
25
Memory (4)
A memory unit stores binary information in groups of
bits called words. The data consists of n lines (for n-bit words). Data input lines provide the information to be stored (written) into the memory, while data output lines carry the information out (read) from the memory. The address consists of k lines which specify which word (among the 2k words available) to be selected for reading or writing. The control lines Read and Write (usually combined into a single control line Read/Write) specifies the direction of transfer of the data.
CS1104-P2-1 Introduction 26
Memory (5)
Block diagram of a memory unit:
n data input lines
n
k address lines
Read/Write
n
Memory (6)
The Write operation:
Transfers the address of the desired word to the
address lines. Transfers the data bits (the word) to be stored in memory to the data input lines. Activates the Write control line (set Read/Write to 0).
address lines. Activates the Read control line (set Read/Write to 1).
Introduction 28
Memory (7)
The Read/Write operation:
Memory Enable Read/Write Memory Operation 0 X None 1 0 Write to selected word 1 1 Read from selected word
Memory (8)
A single memory cell of the static RAM has
the following logic and block diagrams:
Select Select
R
Input
Output
Input
BC
Output
Read/Write
Read/Write
Logic diagram
CS1104-P2-1 Introduction
Block diagram
30
Memory (9)
Logic construction
of a 4 x 3 RAM (with decoder and OR gates):
CS1104-P2-1
Introduction
31
Memory (10)
An array of RAM chips: memory chips are
combined to form larger memory. A 1K x 8-bit RAM chip:
RAM 1K x 8
Input data 8 Address 10 Chip select Read/write DATA (8) ADRS (10) CS RW (8)
8
Output data
Memory (11)
Address
Lines 11 10 Lines 09
Input data
8 lines 01023
DATA (8) (8) ADRS (10) CS 1K x 8 RW
2x4 decoder S0 S1 0 1 2 3
1024 2047
DATA (8) (8) ADRS (10) CS 1K x 8 RW
Read/write
2048 3071
DATA (8) (8) ADRS (10) CS 1K x 8 RW
4K x 8 RAM.
CS1104-P2-1 Introduction
3072 4095
DATA (8) (8) ADRS (10) CS 1K x 8 RW
Output data
33
Memory (12)
21-bit addresses A0 A1 19-bit internal chip address A19 A20
2-bit decoder
D31-24
D23-16
D 15-8
D7-0
Chip select
Another example: Organization of a 2M 32 memory module using 512K 8 static memory chips.
Introduction 34
CS1104-P2-1
End of file