Download presentation
1
CS1104: Computer Organisation http://www.comp.nus.edu.sg/~cs1104
School of Computing National University of Singapore
2
Lecture 1: Introduction
Computer Organisation/Architecture Machine Organisation Buses Instruction Set Architecture (ISA) Questions Clock Cycles Central Processing Unit (CPU) CS1104-P2-1 Introduction
3
Lecture 1: Introduction
Code Execution Memory CS1104-P2-1 Introduction
4
Computer Organisation/Architecture
Computer organisation: electronics engineer’s view of a computer system. Computer architecture: assembly programmer’s view of a computer system – an abstract view. In practice, difficult to distinguish the two. Who needs to study this? Software engineers, embedded systems programmers, computer engineers. CS1104-P2-1 Introduction
5
Computer Organisation/Architecture (2)
In-depth understanding of the inner-workings of modern computers, and trade-offs present at the hardware/software boundary. Emphasis is on the concept understanding and not on the hardware implementation. Textbook: Computer Organizations and Design (The hardware/software interface) by David A. Patterson and John L. Hennessy, Morgan Kaufmann, 2nd ed, 1998. Read Chapter 1.2 and 1.3. CS1104-P2-1 Introduction
6
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
7
Machine Organisation (2)
Processor Control Datapath Memory Devices Input Output Cache Registers Bus CS1104-P2-1 Introduction
8
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. CS1104-P2-1 Introduction
9
Instruction Set Architecture (ISA)
Computer Architecture = Instruction Set + Machine Organisation. The Instruction Set serves as the interface between hardware and software. ISA: “… the attribute of a [computing] system as seen by the programmer, i.e. the conceptual structure and functional behavior, as distinct from the organization of the data flows and controls the logic design, and the physical implementation.” – Amdahl, Blaaw and Brooks, 1964. CS1104-P2-1 Introduction
10
Instruction Set Architecture (ISA) (2)
Compilers,Operating Systems, Programming Languages, Software Engineering Digital Design Circuit Design Compiler Operating System Applications Firmware Datapath & Control Layout I/O system Processor Memory organization Instruction Set Architecture PART 2 PART 1 Electrical Engineering CS1104-P2-1 Introduction
11
Instruction Set Architecture (ISA) (3)
Some examples of ISAs: Digital Alpha (v1, v3) HP PA-RISC (v1.1, v2.0) Sun Sparc (v8, v9) SGI MIPS (MIPS I,II,III,IV,V) Intel (8086,80286,80286, ,Pentium,…) CS1104-P2-1 Introduction
12
Instruction Set Architecture (ISA) (4)
Issues concerning an ISA design: Organisation of programmable storage Data types and data structures: encoding and representations Instruction set Instruction formats Modes of addressing and accessing data items and instructions Exceptional conditions CS1104-P2-1 Introduction
13
Questions Computer architecture is a study of
instruction set architecture only. programming language only. machine organisation only. (a) and (c) (a), (b) and (c) Instruction set architecture is an important interface between digital circuit and datapath control. application software and operating system. application software and hardware organisation. compiler and programming language. high-level programming language and assembly language. [Answer] [Answer] CS1104-P2-1 Introduction
14
Questions (2) Which of the following does not belong to the definition of an ISA? Instruction formats and types. Compilation of a C program into machine code. Encoding and representation of data in memory. Modes of addressing and accessing data in memory. None of the above. Which of the following statements is true? 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. Computer architecture is a subset of the instruction set architecture. [Answer] [Ans] CS1104-P2-1 Introduction
15
Questions (3) Which of the following statements is true about ISA?
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. The ISA of a processor defines the hardware implementation of the processor. None of the above. State whether this statement is true or false: “Changing the hardware machine organisation will definitely change the instruction set architecture (ISA).” [Answer] [False] CS1104-P2-1 Introduction
16
Questions (4) Which of the following can be considered as part of the ISA design? 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. [Answer: (c), (d)] CS1104-P2-1 Introduction
17
Clock Cycles A synchronous system is synchronised according to a clock. Falling edge Rising edge Clock period A clock cycle is the duration between two consecutive rising (falling) edges, and its duration is also known as the clock period. CS1104-P2-1 Introduction
18
Clock Cycles (2) The clock frequency is the reciprocal of clock period, measured in Hertz (Hz): number of cycles per second. A clock with period of 250ns (nano-seconds) has a frequency of 4MHz. A B Clock A has twice the clock period than that of clock B, and half the frequency of B’s. CS1104-P2-1 Introduction
19
Central Processing Unit (CPU)
CPU = Control Unit + ALU + Registers. Control Unit: monitors and directs sequences of instructions. ALU (Arithmetic-Logic Unit): performs simple arithmetic and logical operations. Examples: Add, subtract, and, or, invert, increment, etc. A B ALU select R = A op B n-bits operations R CS1104-P2-1 Introduction
20
Central Processing Unit (CPU) (2)
Registers: Fast memories in the CPU, storing operands, temporary results and status information. General-purpose registers and special registers: PC (program counter) ACC (accumulator) IR (instruction register) MAR (memory address register) MBR (memory buffer register) or MDR (memory data register) CS1104-P2-1 Introduction
21
Code Execution Program in High-level language (C, Pascal, etc)
Compile program into assembly language Assemble program to machine language Link multiple machine-language programs to one program Load program into computer’s memory Execute program CS1104-P2-1 Introduction
22
Code Execution (2) Instruction Fetch Decode Operand Execute Result Store Next Instruction execution cycle: fetch, decode, execute. Fetch: fetch next instruction (using PC) from memory into IR. Decode: decode the instruction. Execute: execute instruction. CS1104-P2-1 Introduction
23
Memory Memory stores programs and data. Definitions:
1 byte = 8 bits 1 word: in multiple of bytes; a unit of transfer 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. Desirable properties: fast access, large capacity, economical cost, non-volatile. However, most memory devices do not possess all these properties. CS1104-P2-1 Introduction
24
Memory (2) Memory hierarchy: Fast, expensive (small numbers), volatile
registers main memory disk storage magnetic tapes Fast, expensive (small numbers), volatile Slow, cheap (large numbers), non-volatile CS1104-P2-1 Introduction
25
Up to 2k addressable locations.
Memory (3) Data transfer: Address k-bit address bus 1 2 3 4 5 Processor MAR MDR Memory : n-bit data bus Control lines (R/W, etc.) Up to 2k addressable locations. CS1104-P2-1 Introduction
26
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
27
Memory (5) Block diagram of a memory unit: n data input lines
2k words n bits per word k address lines k Read/Write n n data input lines n data output lines CS1104-P2-1 Introduction
28
Memory (6) The Write operation: The Read 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). The Read operation: Activates the Read control line (set Read/Write to 1). CS1104-P2-1 Introduction
29
Memory (7) The Read/Write operation:
Two types of RAM: Static and dynamic. Static RAMs use flip-flops as the memory cells. Dynamic RAMs use capacitor charges to represent data. Though simpler in circuitry, they have to be constantly refreshed. CS1104-P2-1 Introduction
30
Memory (8) A single memory cell of the static RAM has the following logic and block diagrams: R S Q Input Select Output Read/Write BC Logic diagram Block diagram CS1104-P2-1 Introduction
31
Memory (9) Logic construction of a 4 x 3 RAM (with decoder and OR gates): CS1104-P2-1 Introduction
32
Block diagram of a 1K x 8 RAM chip
Memory (10) An array of RAM chips: memory chips are combined to form larger memory. A 1K x 8-bit RAM chip: Block diagram of a 1K x 8 RAM chip RAM 1K x 8 DATA (8) ADRS (10) CS RW Input data Address Chip select Read/write (8) Output data 8 10 CS1104-P2-1 Introduction
33
Memory (11) 4K x 8 RAM. Address Input data 2x4 decoder S0 1 2 S1 3
ADRS (10) CS RW Read/write (8) Output data 0–1023 1024 – 2047 2048 – 3071 3072 – 4095 Input data 8 lines 1 2 3 2x4 decoder Lines 0 – 9 S0 S1 Address 4K x 8 RAM. CS1104-P2-1 Introduction
34
Memory (12) Another example:
19-bit internal chip address 2-bit decoder addresses 21-bit A 1 19 512k X 8 memory chip 20 D 31-24 7-0 23-16 15-8 Chip select 512K x 8 memory chip 19-bit address 8-bit data input/output Another example: Organization of a 2M 32 memory module using 512K 8 static memory chips. CS1104-P2-1 Introduction
35
End of file
Similar presentations
© 2025 SlidePlayer.com. Inc.
All rights reserved.