38
5-1 Chapter 5 - Datapath and Control Computer Architecture and Organization by M. Murdocca and V. Heuring © 2007 M. Murdocca and V. Heuring Computer Architecture and Organization Miles Murdocca and Vincent Heuring Chapter 5 – Datapath and Control

5-1 Chapter 5 - Datapath and Control Computer Architecture and Organization by M. Murdocca and V. Heuring © 2007 M. Murdocca and V. Heuring Computer Architecture

Embed Size (px)

Citation preview

Page 1: 5-1 Chapter 5 - Datapath and Control Computer Architecture and Organization by M. Murdocca and V. Heuring © 2007 M. Murdocca and V. Heuring Computer Architecture

5-1 Chapter 5 - Datapath and Control

Computer Architecture and Organization by M. Murdocca and V. Heuring © 2007 M. Murdocca and V. Heuring

Computer Architecture and Organization

Miles Murdocca and Vincent Heuring

Chapter 5 – Datapath

and Control

Page 2: 5-1 Chapter 5 - Datapath and Control Computer Architecture and Organization by M. Murdocca and V. Heuring © 2007 M. Murdocca and V. Heuring Computer Architecture

5-2 Chapter 5 - Datapath and Control

Computer Architecture and Organization by M. Murdocca and V. Heuring © 2007 M. Murdocca and V. Heuring

Chapter Contents

5.1 Basics of the Microarchitecture

5.2 The Datapath

5.3 The Control Section – Microprogrammed

5.4 The Control Section – Hardwired

5.5 Case Study: The VHDL Hardware Description Language

5.6 Case Study: What Happens when a Computer Boots Up?

Page 3: 5-1 Chapter 5 - Datapath and Control Computer Architecture and Organization by M. Murdocca and V. Heuring © 2007 M. Murdocca and V. Heuring Computer Architecture

5-3 Chapter 5 - Datapath and Control

Computer Architecture and Organization by M. Murdocca and V. Heuring © 2007 M. Murdocca and V. Heuring

The Fetch-Execute Cycle

• The steps that the control unit carries out in executing a program are:

(1) Fetch the next instruction to be executed from memory.

(2) Decode the opcode.

(3) Read operand(s) from main memory, if any.

(4) Execute the instruction and store results, if any.

(5) Go to step 1.

Page 4: 5-1 Chapter 5 - Datapath and Control Computer Architecture and Organization by M. Murdocca and V. Heuring © 2007 M. Murdocca and V. Heuring Computer Architecture

5-4 Chapter 5 - Datapath and Control

Computer Architecture and Organization by M. Murdocca and V. Heuring © 2007 M. Murdocca and V. Heuring

High Level View of Microarchitecture• The microarchitecture consists of the control unit and the

programmer-visible registers, functional units such as the ALU, and any additional registers that may be required by the control unit.

Page 5: 5-1 Chapter 5 - Datapath and Control Computer Architecture and Organization by M. Murdocca and V. Heuring © 2007 M. Murdocca and V. Heuring Computer Architecture

5-5 Chapter 5 - Datapath and Control

Computer Architecture and Organization by M. Murdocca and V. Heuring © 2007 M. Murdocca and V. Heuring

A More Detailed View

Page 6: 5-1 Chapter 5 - Datapath and Control Computer Architecture and Organization by M. Murdocca and V. Heuring © 2007 M. Murdocca and V. Heuring Computer Architecture

5-6 Chapter 5 - Datapath and Control

Computer Architecture and Organization by M. Murdocca and V. Heuring © 2007 M. Murdocca and V. Heuring

ARC Instruction Subset

Page 7: 5-1 Chapter 5 - Datapath and Control Computer Architecture and Organization by M. Murdocca and V. Heuring © 2007 M. Murdocca and V. Heuring Computer Architecture

5-7 Chapter 5 - Datapath and Control

Computer Architecture and Organization by M. Murdocca and V. Heuring © 2007 M. Murdocca and V. Heuring

ARC Instruction Formats

Page 8: 5-1 Chapter 5 - Datapath and Control Computer Architecture and Organization by M. Murdocca and V. Heuring © 2007 M. Murdocca and V. Heuring Computer Architecture

5-8 Chapter 5 - Datapath and Control

Computer Architecture and Organization by M. Murdocca and V. Heuring © 2007 M. Murdocca and V. Heuring

ARC Datapath

Page 9: 5-1 Chapter 5 - Datapath and Control Computer Architecture and Organization by M. Murdocca and V. Heuring © 2007 M. Murdocca and V. Heuring Computer Architecture

5-9 Chapter 5 - Datapath and Control

Computer Architecture and Organization by M. Murdocca and V. Heuring © 2007 M. Murdocca and V. Heuring

ARC ALU Operations

Page 10: 5-1 Chapter 5 - Datapath and Control Computer Architecture and Organization by M. Murdocca and V. Heuring © 2007 M. Murdocca and V. Heuring Computer Architecture

5-10 Chapter 5 - Datapath and Control

Computer Architecture and Organization by M. Murdocca and V. Heuring © 2007 M. Murdocca and V. Heuring

Block Diagram of ALU

Page 11: 5-1 Chapter 5 - Datapath and Control Computer Architecture and Organization by M. Murdocca and V. Heuring © 2007 M. Murdocca and V. Heuring Computer Architecture

5-11 Chapter 5 - Datapath and Control

Computer Architecture and Organization by M. Murdocca and V. Heuring © 2007 M. Murdocca and V. Heuring

Gate-Level Layout of Barrel Shifter

Page 12: 5-1 Chapter 5 - Datapath and Control Computer Architecture and Organization by M. Murdocca and V. Heuring © 2007 M. Murdocca and V. Heuring Computer Architecture

5-12 Chapter 5 - Datapath and Control

Computer Architecture and Organization by M. Murdocca and V. Heuring © 2007 M. Murdocca and V. Heuring

Truth Table for (Most of the) ALU LUTs

Page 13: 5-1 Chapter 5 - Datapath and Control Computer Architecture and Organization by M. Murdocca and V. Heuring © 2007 M. Murdocca and V. Heuring Computer Architecture

5-13 Chapter 5 - Datapath and Control

Computer Architecture and Organization by M. Murdocca and V. Heuring © 2007 M. Murdocca and V. Heuring

Design of Register %r1

Page 14: 5-1 Chapter 5 - Datapath and Control Computer Architecture and Organization by M. Murdocca and V. Heuring © 2007 M. Murdocca and V. Heuring Computer Architecture

5-14 Chapter 5 - Datapath and Control

Computer Architecture and Organization by M. Murdocca and V. Heuring © 2007 M. Murdocca and V. Heuring

Outputs to Control Unit fromRegister %ir

Page 15: 5-1 Chapter 5 - Datapath and Control Computer Architecture and Organization by M. Murdocca and V. Heuring © 2007 M. Murdocca and V. Heuring Computer Architecture

5-15 Chapter 5 - Datapath and Control

Computer Architecture and Organization by M. Murdocca and V. Heuring © 2007 M. Murdocca and V. Heuring

Microarch-itecture of the ARC

Page 16: 5-1 Chapter 5 - Datapath and Control Computer Architecture and Organization by M. Murdocca and V. Heuring © 2007 M. Murdocca and V. Heuring Computer Architecture

5-16 Chapter 5 - Datapath and Control

Computer Architecture and Organization by M. Murdocca and V. Heuring © 2007 M. Murdocca and V. Heuring

Microword Format

Page 17: 5-1 Chapter 5 - Datapath and Control Computer Architecture and Organization by M. Murdocca and V. Heuring © 2007 M. Murdocca and V. Heuring Computer Architecture

5-17 Chapter 5 - Datapath and Control

Computer Architecture and Organization by M. Murdocca and V. Heuring © 2007 M. Murdocca and V. Heuring

Settings for the COND Field of the Microword

Page 18: 5-1 Chapter 5 - Datapath and Control Computer Architecture and Organization by M. Murdocca and V. Heuring © 2007 M. Murdocca and V. Heuring Computer Architecture

5-18 Chapter 5 - Datapath and Control

Computer Architecture and Organization by M. Murdocca and V. Heuring © 2007 M. Murdocca and V. Heuring

DECODE Format for Microinstruction Address

Page 19: 5-1 Chapter 5 - Datapath and Control Computer Architecture and Organization by M. Murdocca and V. Heuring © 2007 M. Murdocca and V. Heuring Computer Architecture

5-19 Chapter 5 - Datapath and Control

Computer Architecture and Organization by M. Murdocca and V. Heuring © 2007 M. Murdocca and V. Heuring

Timing Relationships for the Registers

Page 20: 5-1 Chapter 5 - Datapath and Control Computer Architecture and Organization by M. Murdocca and V. Heuring © 2007 M. Murdocca and V. Heuring Computer Architecture

5-20 Chapter 5 - Datapath and Control

Computer Architecture and Organization by M. Murdocca and V. Heuring © 2007 M. Murdocca and V. Heuring

Partial ARC

Micro-program

Page 21: 5-1 Chapter 5 - Datapath and Control Computer Architecture and Organization by M. Murdocca and V. Heuring © 2007 M. Murdocca and V. Heuring Computer Architecture

5-21 Chapter 5 - Datapath and Control

Computer Architecture and Organization by M. Murdocca and V. Heuring © 2007 M. Murdocca and V. Heuring

Partial ARC Microprogram

(cont’)

Page 22: 5-1 Chapter 5 - Datapath and Control Computer Architecture and Organization by M. Murdocca and V. Heuring © 2007 M. Murdocca and V. Heuring Computer Architecture

5-22 Chapter 5 - Datapath and Control

Computer Architecture and Organization by M. Murdocca and V. Heuring © 2007 M. Murdocca and V. Heuring

Translating the Microprogram0: R[ir] ← AND(R[pc],R[pc]); READ;

1: DECODE; /256-way jump according to opcode

Page 23: 5-1 Chapter 5 - Datapath and Control Computer Architecture and Organization by M. Murdocca and V. Heuring © 2007 M. Murdocca and V. Heuring Computer Architecture

5-23 Chapter 5 - Datapath and Control

Computer Architecture and Organization by M. Murdocca and V. Heuring © 2007 M. Murdocca and V. Heuring

Branch Decoding• Decoding tree for

branch instructions shows corresponding microprogram lines:

Page 24: 5-1 Chapter 5 - Datapath and Control Computer Architecture and Organization by M. Murdocca and V. Heuring © 2007 M. Murdocca and V. Heuring Computer Architecture

5-24 Chapter 5 - Datapath and Control

Computer Architecture and Organization by M. Murdocca and V. Heuring © 2007 M. Murdocca and V. Heuring

Assembled ARC

Microprogram

Page 25: 5-1 Chapter 5 - Datapath and Control Computer Architecture and Organization by M. Murdocca and V. Heuring © 2007 M. Murdocca and V. Heuring Computer Architecture

5-25 Chapter 5 - Datapath and Control

Computer Architecture and Organization by M. Murdocca and V. Heuring © 2007 M. Murdocca and V. Heuring

Assembled ARC

Microprogram (cont’)

Page 26: 5-1 Chapter 5 - Datapath and Control Computer Architecture and Organization by M. Murdocca and V. Heuring © 2007 M. Murdocca and V. Heuring Computer Architecture

5-26 Chapter 5 - Datapath and Control

Computer Architecture and Organization by M. Murdocca and V. Heuring © 2007 M. Murdocca and V. Heuring

Example: Add the subcc Instruction• Consider adding instruction subcc (subtract) to the ARC instruction set.

subcc uses the Arithmetic format and op3 = 001100.

Page 27: 5-1 Chapter 5 - Datapath and Control Computer Architecture and Organization by M. Murdocca and V. Heuring © 2007 M. Murdocca and V. Heuring Computer Architecture

5-27 Chapter 5 - Datapath and Control

Computer Architecture and Organization by M. Murdocca and V. Heuring © 2007 M. Murdocca and V. Heuring

Branch Table• A branch table for trap handlers and interrupt service routines:

Page 28: 5-1 Chapter 5 - Datapath and Control Computer Architecture and Organization by M. Murdocca and V. Heuring © 2007 M. Murdocca and V. Heuring Computer Architecture

5-28 Chapter 5 - Datapath and Control

Computer Architecture and Organization by M. Murdocca and V. Heuring © 2007 M. Murdocca and V. Heuring

Microprogramming vs. Nanoprogramming

(a) Micropro-gramming,

(b) nano-programming.

Page 29: 5-1 Chapter 5 - Datapath and Control Computer Architecture and Organization by M. Murdocca and V. Heuring © 2007 M. Murdocca and V. Heuring Computer Architecture

5-29 Chapter 5 - Datapath and Control

Computer Architecture and Organization by M. Murdocca and V. Heuring © 2007 M. Murdocca and V. Heuring

Hardware Description Language

• HDL sequence for a resettable modulo 4 counter.

Page 30: 5-1 Chapter 5 - Datapath and Control Computer Architecture and Organization by M. Murdocca and V. Heuring © 2007 M. Murdocca and V. Heuring Computer Architecture

5-30 Chapter 5 - Datapath and Control

Computer Architecture and Organization by M. Murdocca and V. Heuring © 2007 M. Murdocca and V. Heuring

Circuit Derived from HDL

• Logic design for a modulo 4 counter described in HDL.

Page 31: 5-1 Chapter 5 - Datapath and Control Computer Architecture and Organization by M. Murdocca and V. Heuring © 2007 M. Murdocca and V. Heuring Computer Architecture

5-31 Chapter 5 - Datapath and Control

Computer Architecture and Organization by M. Murdocca and V. Heuring © 2007 M. Murdocca and V. Heuring

HDL for ARC

• HDL description of the ARC control unit.

Page 32: 5-1 Chapter 5 - Datapath and Control Computer Architecture and Organization by M. Murdocca and V. Heuring © 2007 M. Murdocca and V. Heuring Computer Architecture

5-32 Chapter 5 - Datapath and Control

Computer Architecture and Organization by M. Murdocca and V. Heuring © 2007 M. Murdocca and V. Heuring

HDL for ARC (cont’)

Page 33: 5-1 Chapter 5 - Datapath and Control Computer Architecture and Organization by M. Murdocca and V. Heuring © 2007 M. Murdocca and V. Heuring Computer Architecture

5-33 Chapter 5 - Datapath and Control

Computer Architecture and Organization by M. Murdocca and V. Heuring © 2007 M. Murdocca and V. Heuring

HDL ARC Circuit

• The hardwired control section of the ARC: generation of the control signals.

Page 34: 5-1 Chapter 5 - Datapath and Control Computer Architecture and Organization by M. Murdocca and V. Heuring © 2007 M. Murdocca and V. Heuring Computer Architecture

5-34 Chapter 5 - Datapath and Control

Computer Architecture and Organization by M. Murdocca and V. Heuring © 2007 M. Murdocca and V. Heuring

HDL ARC Circuit (cont’)

• Hardwired control section of the ARC: signals from the data section of the control unit to the datapath.

Page 35: 5-1 Chapter 5 - Datapath and Control Computer Architecture and Organization by M. Murdocca and V. Heuring © 2007 M. Murdocca and V. Heuring Computer Architecture

5-35 Chapter 5 - Datapath and Control

Computer Architecture and Organization by M. Murdocca and V. Heuring © 2007 M. Murdocca and V. Heuring

Case Study: The VHDL Hardware Description Language

• The majority function. a) truth table, b) AND-OR implementation, c) black box representation.

Page 36: 5-1 Chapter 5 - Datapath and Control Computer Architecture and Organization by M. Murdocca and V. Heuring © 2007 M. Murdocca and V. Heuring Computer Architecture

5-36 Chapter 5 - Datapath and Control

Computer Architecture and Organization by M. Murdocca and V. Heuring © 2007 M. Murdocca and V. Heuring

VHDL SpecificationInterface specification for the majority component

-- Interfaceentity MAJORITY is port

(A_IN, B_IN, C_IN: in BIT F_OUT: out BIT);

end MAJORITY;Behavioral model for the majority component -- Body

architecture LOGIC_SPEC of MAJORITY isbegin-- compute the output using a Boolean expressionF_OUT <= (not A_IN and B_IN and C_IN) or

(A_IN and not B_IN and C_IN) or(A_IN and B_IN and not C_IN) or(A_IN and B_IN and C_IN) after 4 ns;

end LOGIC_SPEC;

Page 37: 5-1 Chapter 5 - Datapath and Control Computer Architecture and Organization by M. Murdocca and V. Heuring © 2007 M. Murdocca and V. Heuring Computer Architecture

5-37 Chapter 5 - Datapath and Control

Computer Architecture and Organization by M. Murdocca and V. Heuring © 2007 M. Murdocca and V. Heuring

VHDL Specification (cont’)-- Package declaration, in library WORKpackage LOGIC_GATES iscomponent AND3 port (A, B, C : in BIT; X : out BIT);end component;component OR4 port (A, B, C, D : in BIT; X : out BIT);end component;component NOT1 port (A : in BIT; X : out BIT);end component;-- Interfaceentity MAJORITY is port

(A_IN, B_IN, C_IN: in BITF_OUT: out BIT);

end MAJORITY;

Page 38: 5-1 Chapter 5 - Datapath and Control Computer Architecture and Organization by M. Murdocca and V. Heuring © 2007 M. Murdocca and V. Heuring Computer Architecture

5-38 Chapter 5 - Datapath and Control

Computer Architecture and Organization by M. Murdocca and V. Heuring © 2007 M. Murdocca and V. Heuring

VHDL Specification (cont’)-- Body-- Uses components declared in package LOGIC_GATES -- in the WORK library-- import all the components in WORK.LOGIC_GATESuse WORK.LOGIC_GATES.all architecture LOGIC_SPEC of MAJORITY is-- declare signals used internally in MAJORITYsignal A_BAR, B_BAR, C_BAR, I1, I2, I3, I4: BIT;begin-- connect the logic gatesNOT_1 : NOT1 port map (A_IN, A_BAR);NOT_2 : NOT1 port map (B_IN, B_BAR);NOT_3 : NOT1 port map (C_IN, C_BAR);AND_1 : AND3 port map (A_BAR, B_IN, C_IN, I1);AND_2 : AND3 port map (A_IN, B_BAR, C_IN, I2);AND_3 : AND3 port map (A_IN, B_IN, C_BAR, I3);AND_4 : AND3 port map (A_IN, B_IN, C_IN, I4);OR_1 : OR3 port map (I1, I2, I3, I4, F_OUT);end LOGIC_SPEC;