Computer Architecture and Organization Unit I Introduction Architecture

  • Slides: 34
Download presentation
Computer Architecture and Organization Unit I: - Introduction

Computer Architecture and Organization Unit I: - Introduction

Architecture & Organization l Architecture is those attributes visible to the programmer l l

Architecture & Organization l Architecture is those attributes visible to the programmer l l l Instruction set, number of bits used for data representation, I/O mechanisms, addressing techniques. e. g. Is there a multiply instruction? Organization is how features are implemented l l Control signals, interfaces, memory technology. e. g. Is there a hardware multiply unit or is it done by repeated addition?

Functional Units

Functional Units

Functional Units Arithmetic and logic Input Memory Output Control I/O Processor Figure 1. 1.

Functional Units Arithmetic and logic Input Memory Output Control I/O Processor Figure 1. 1. Basic functional units of a computer.

Information Handled by a Computer l Instructions/machine instructions Ø Ø Govern the transfer of

Information Handled by a Computer l Instructions/machine instructions Ø Ø Govern the transfer of information within a processor as well as between the processor and its I/O devices Specify the arithmetic and logic operations to be performed (e. g. Mov, Add, Sub, Mul, Load, Store, Halt etc. ) Program- Set of executable instructions. l Data Ø Used as operands by the instructions Source program (e. g. A, B, C=20 etc. ) Ø Ø l l Information stored in Computer Consists of Instructions and or Data. Encoded in binary code – 0 and 1

1. Input Unit l l l Computer accepts some coded information through input units,

1. Input Unit l l l Computer accepts some coded information through input units, which read the data. Whenever the key is pressed the corresponding letter/ digit is automatically translated into its corresponding code (i. e. encoding is performed) and send directly to memory or processor. E. g. Keyboards, Mice, joysticks, Trackballs etc

2. Output Unit l l Function of this unit is to send/ display the

2. Output Unit l l Function of this unit is to send/ display the results or processed information to the outside world. E. g. Monitor, Printer etc.

3. Memory Unit l Store programs and data ( 1 s and 0 s

3. Memory Unit l Store programs and data ( 1 s and 0 s ) Two classes of storage Ø Primary storage v v Fast Programs must be stored in memory while they are being executed Large number of semiconductor storage cells Processed in words Address RAM and memory access time Ø Secondary storage – larger in size and cheaper in cost Ø Memory hierarchy – cache, main memory and Secondary Memory l v v

4. Arithmetic and Logic Unit (ALU) l l Most computer operations are executed in

4. Arithmetic and Logic Unit (ALU) l l Most computer operations are executed in ALU of the processor. Load the operands into memory – bring them to the processor – perform operation in ALU – store the result back to memory or retain in the processor. Registers Fast control of ALU

5. Control Unit l l l All computer operations are controlled by the control

5. Control Unit l l l All computer operations are controlled by the control unit. The timing signals that govern the I/O transfers are also generated by the control unit. Control unit is usually distributed throughout the machine instead of standing alone.

Structure & Function l l l Structure is the way in which components relate

Structure & Function l l l Structure is the way in which components relate to each other Function is the operation of individual components as part of the structure All computer functions are: l l Data processing Data storage Data movement Control

Structure - Top Level Peripherals Computer Central Processing Unit Computer Systems Interconnection Input Output

Structure - Top Level Peripherals Computer Central Processing Unit Computer Systems Interconnection Input Output Communication lines Main Memory

Structure - The CPU Computer Arithmetic and Login Unit Registers I/O System Bus Memory

Structure - The CPU Computer Arithmetic and Login Unit Registers I/O System Bus Memory CPU Internal CPU Interconnection Control Unit

Structure - The Control Unit CPU Sequencing Login ALU Internal Bus Registers Control Unit

Structure - The Control Unit CPU Sequencing Login ALU Internal Bus Registers Control Unit Registers and Decoders Control Memory

Basic Operational Concepts

Basic Operational Concepts

Operations of a computer: Accept information in the form of programs and data through

Operations of a computer: Accept information in the form of programs and data through an input unit and store it in the memory Ø Fetch the information stored in the memory, under program control, into an CPU, where the information is processed Ø Output the processed information through an output unit Ø Control all activities inside the machine through a control unit Ø

Review l l Activity in a computer is governed by instructions. To perform a

Review l l Activity in a computer is governed by instructions. To perform a task, an appropriate program consisting of a list of instructions is stored in the memory. Individual instructions are brought from the memory into the processor, which executes the specified operations. Data to be used as operands are also stored in the memory.

A Typical Instruction l l l Add R 0, Loc A or ADD R

A Typical Instruction l l l Add R 0, Loc A or ADD R 0 , [A] Add the operand at memory location LOCA to the operand in a register R 0 in the processor. Place the sum into register R 0. The original contents of LOCA are preserved. The original contents of R 0 is overwritten. Instruction is fetched from the memory into the processor – the operand at LOCA is fetched and added to the contents of R 0 – the resulting sum is stored in register R 0.

Computer Components: Top Level View

Computer Components: Top Level View

Connection Between the Processor and the Memory

Connection Between the Processor and the Memory

Instruction Cycle l Two steps: l l Fetch Execute

Instruction Cycle l Two steps: l l Fetch Execute

Fetch Cycle l l l Program Counter (PC) holds address of next instruction to

Fetch Cycle l l l Program Counter (PC) holds address of next instruction to fetch Processor fetches instruction from memory location pointed to by PC Increment PC l l l Unless told otherwise Instruction loaded into Instruction Register (IR) Processor interprets instruction and performs required actions

Execute Cycle l Processor-memory l l Processor I/O l l Some arithmetic or logical

Execute Cycle l Processor-memory l l Processor I/O l l Some arithmetic or logical operation on data Control l Data transfer between CPU and I/O module Data processing l l data transfer between CPU and main memory Alteration of sequence of operations e. g. jump Combination of above

Registers l l l Instruction register (IR) Program counter (PC) General-purpose register (R 0

Registers l l l Instruction register (IR) Program counter (PC) General-purpose register (R 0 – Rn-1) Memory address register (MAR) Memory data register (MDR)

Typical Operating Steps l l l l Programs reside in the memory through input

Typical Operating Steps l l l l Programs reside in the memory through input devices PC is set to point to the first instruction The contents of PC are transferred to MAR A Read signal is sent to the memory The first instruction is read out and loaded into MDR The contents of MDR are transferred to IR Decode and execute the instruction

Typical Operating Steps (Cont’) l Get operands for ALU Ø Ø General-purpose register Memory

Typical Operating Steps (Cont’) l Get operands for ALU Ø Ø General-purpose register Memory (address to MAR – Read – MDR to ALU) Perform operation in ALU l Store the result back l Ø Ø l To general-purpose register To memory (address to MAR, result to MDR – Write) During the execution, PC is incremented to the next instruction

Instruction Cycle State Diagram

Instruction Cycle State Diagram

Bus Structures l l There are many ways to connect different parts inside a

Bus Structures l l There are many ways to connect different parts inside a computer together. A group of lines that serves as a connecting path for several devices is called a bus. Single and multiple BUS structures are most common Address/data/control ( Single System Bus)

Bus Structure l Single-bus

Bus Structure l Single-bus

Data Bus l Carries data l l Remember that there is no difference between

Data Bus l Carries data l l Remember that there is no difference between “data” and “instruction” at this level Width is a key determinant of performance l 8, 16, 32, 64 bit

Address bus l l l Identify the source or destination of data e. g.

Address bus l l l Identify the source or destination of data e. g. CPU needs to read an instruction (data) from a given location in memory Bus width determines maximum memory capacity of system l e. g. 8080 has 16 bit address bus giving 64 k address space

Control Bus l Control and timing information l l l Memory read/write signal Interrupt

Control Bus l Control and timing information l l l Memory read/write signal Interrupt request Clock signals

TWO BUS STRUCTURE

TWO BUS STRUCTURE

THREE BUS STRUCTURE

THREE BUS STRUCTURE