principles of computer architecturemhtay/cpsc352/itec352_power_point/ch06poca.pdf · department of...

36
6-1 Chapter 6 - Datapath and Control Department of Information Technology, Radford University ITEC 352 Computer Organization Principles of Computer Architecture Miles Murdocca and Vincent Heuring Chapter 6: Datapath and Control

Upload: others

Post on 21-Mar-2020

11 views

Category:

Documents


0 download

TRANSCRIPT

Page 1: Principles of Computer Architecturemhtay/CPSC352/ITEC352_Power_Point/Ch06POCA.pdf · Department of Information Technology, Radford University ITEC 352 Computer Organization The Fetch-Execute

6-1 Chapter 6 - Datapath and Control

Department of Information Technology, Radford University ITEC 352 Computer Organization

Principles of Computer ArchitectureMiles Murdocca and Vincent Heuring

Chapter 6: Datapath and Control

Page 2: Principles of Computer Architecturemhtay/CPSC352/ITEC352_Power_Point/Ch06POCA.pdf · Department of Information Technology, Radford University ITEC 352 Computer Organization The Fetch-Execute

6-2 Chapter 6 - Datapath and Control

Department of Information Technology, Radford University ITEC 352 Computer Organization

Chapter Contents6.1 Basics of the Microarchitecture6.2 A Microarchitecture for the ARC6.3 Hardwired Control6.4 Case Study: The VHDL Hardware Description Language

Page 3: Principles of Computer Architecturemhtay/CPSC352/ITEC352_Power_Point/Ch06POCA.pdf · Department of Information Technology, Radford University ITEC 352 Computer Organization The Fetch-Execute

6-3 Chapter 6 - Datapath and Control

Department of Information Technology, Radford University ITEC 352 Computer Organization

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.(5) Go to step 1.

Page 4: Principles of Computer Architecturemhtay/CPSC352/ITEC352_Power_Point/Ch06POCA.pdf · Department of Information Technology, Radford University ITEC 352 Computer Organization The Fetch-Execute

6-4 Chapter 6 - Datapath and Control

Department of Information Technology, Radford University ITEC 352 Computer Organization

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: Principles of Computer Architecturemhtay/CPSC352/ITEC352_Power_Point/Ch06POCA.pdf · Department of Information Technology, Radford University ITEC 352 Computer Organization The Fetch-Execute

6-5 Chapter 6 - Datapath and Control

Department of Information Technology, Radford University ITEC 352 Computer Organization

ARC Instruction Subset

Page 6: Principles of Computer Architecturemhtay/CPSC352/ITEC352_Power_Point/Ch06POCA.pdf · Department of Information Technology, Radford University ITEC 352 Computer Organization The Fetch-Execute

6-6 Chapter 6 - Datapath and Control

Department of Information Technology, Radford University ITEC 352 Computer Organization

ARC Instruction Formats

Page 7: Principles of Computer Architecturemhtay/CPSC352/ITEC352_Power_Point/Ch06POCA.pdf · Department of Information Technology, Radford University ITEC 352 Computer Organization The Fetch-Execute

6-7 Chapter 6 - Datapath and Control

Department of Information Technology, Radford University ITEC 352 Computer Organization

ARC Datapath

Page 8: Principles of Computer Architecturemhtay/CPSC352/ITEC352_Power_Point/Ch06POCA.pdf · Department of Information Technology, Radford University ITEC 352 Computer Organization The Fetch-Execute

6-8 Chapter 6 - Datapath and Control

Department of Information Technology, Radford University ITEC 352 Computer Organization

ARC ALU Operations

Page 9: Principles of Computer Architecturemhtay/CPSC352/ITEC352_Power_Point/Ch06POCA.pdf · Department of Information Technology, Radford University ITEC 352 Computer Organization The Fetch-Execute

6-9 Chapter 6 - Datapath and Control

Department of Information Technology, Radford University ITEC 352 Computer Organization

Block Diagram of ALU

Page 10: Principles of Computer Architecturemhtay/CPSC352/ITEC352_Power_Point/Ch06POCA.pdf · Department of Information Technology, Radford University ITEC 352 Computer Organization The Fetch-Execute

6-10 Chapter 6 - Datapath and Control

Department of Information Technology, Radford University ITEC 352 Computer Organization

Gate-Level Layout of Barrel Shifter

Page 11: Principles of Computer Architecturemhtay/CPSC352/ITEC352_Power_Point/Ch06POCA.pdf · Department of Information Technology, Radford University ITEC 352 Computer Organization The Fetch-Execute

6-11 Chapter 6 - Datapath and Control

Department of Information Technology, Radford University ITEC 352 Computer Organization

Truth Table for (Most of the) ALU LUTs

Page 12: Principles of Computer Architecturemhtay/CPSC352/ITEC352_Power_Point/Ch06POCA.pdf · Department of Information Technology, Radford University ITEC 352 Computer Organization The Fetch-Execute

6-12 Chapter 6 - Datapath and Control

Department of Information Technology, Radford University ITEC 352 Computer Organization

Design of Register %r1

Page 13: Principles of Computer Architecturemhtay/CPSC352/ITEC352_Power_Point/Ch06POCA.pdf · Department of Information Technology, Radford University ITEC 352 Computer Organization The Fetch-Execute

6-13 Chapter 6 - Datapath and Control

Department of Information Technology, Radford University ITEC 352 Computer Organization

Outputs to Control Unit fromRegister %ir

Page 14: Principles of Computer Architecturemhtay/CPSC352/ITEC352_Power_Point/Ch06POCA.pdf · Department of Information Technology, Radford University ITEC 352 Computer Organization The Fetch-Execute

6-14 Chapter 6 - Datapath and Control

Department of Information Technology, Radford University ITEC 352 Computer Organization

Microarch-itecture of the ARC

Page 15: Principles of Computer Architecturemhtay/CPSC352/ITEC352_Power_Point/Ch06POCA.pdf · Department of Information Technology, Radford University ITEC 352 Computer Organization The Fetch-Execute

6-15 Chapter 6 - Datapath and Control

Department of Information Technology, Radford University ITEC 352 Computer Organization

Microword Format

Page 16: Principles of Computer Architecturemhtay/CPSC352/ITEC352_Power_Point/Ch06POCA.pdf · Department of Information Technology, Radford University ITEC 352 Computer Organization The Fetch-Execute

6-16 Chapter 6 - Datapath and Control

Department of Information Technology, Radford University ITEC 352 Computer Organization

Settings for the COND Field of the Microword

Page 17: Principles of Computer Architecturemhtay/CPSC352/ITEC352_Power_Point/Ch06POCA.pdf · Department of Information Technology, Radford University ITEC 352 Computer Organization The Fetch-Execute

6-17 Chapter 6 - Datapath and Control

Department of Information Technology, Radford University ITEC 352 Computer Organization

DECODE Format for Microinstruction Address

Page 18: Principles of Computer Architecturemhtay/CPSC352/ITEC352_Power_Point/Ch06POCA.pdf · Department of Information Technology, Radford University ITEC 352 Computer Organization The Fetch-Execute

6-18 Chapter 6 - Datapath and Control

Department of Information Technology, Radford University ITEC 352 Computer Organization

Timing Relationships for the Registers

Page 19: Principles of Computer Architecturemhtay/CPSC352/ITEC352_Power_Point/Ch06POCA.pdf · Department of Information Technology, Radford University ITEC 352 Computer Organization The Fetch-Execute

6-19 Chapter 6 - Datapath and Control

Department of Information Technology, Radford University ITEC 352 Computer Organization

Partial ARC

Micro-program

Page 20: Principles of Computer Architecturemhtay/CPSC352/ITEC352_Power_Point/Ch06POCA.pdf · Department of Information Technology, Radford University ITEC 352 Computer Organization The Fetch-Execute

6-20 Chapter 6 - Datapath and Control

Department of Information Technology, Radford University ITEC 352 Computer Organization

Partial ARC Microprogram

(cont’)

Page 21: Principles of Computer Architecturemhtay/CPSC352/ITEC352_Power_Point/Ch06POCA.pdf · Department of Information Technology, Radford University ITEC 352 Computer Organization The Fetch-Execute

6-21 Chapter 6 - Datapath and Control

Department of Information Technology, Radford University ITEC 352 Computer Organization

Branch Decoding• Decoding tree for

branch instructions shows corresponding microprogramlines:

Page 22: Principles of Computer Architecturemhtay/CPSC352/ITEC352_Power_Point/Ch06POCA.pdf · Department of Information Technology, Radford University ITEC 352 Computer Organization The Fetch-Execute

6-22 Chapter 6 - Datapath and Control

Department of Information Technology, Radford University ITEC 352 Computer Organization

Assembled ARC

Microprogram

Page 23: Principles of Computer Architecturemhtay/CPSC352/ITEC352_Power_Point/Ch06POCA.pdf · Department of Information Technology, Radford University ITEC 352 Computer Organization The Fetch-Execute

6-23 Chapter 6 - Datapath and Control

Department of Information Technology, Radford University ITEC 352 Computer Organization

Assembled ARC

Microprogram(cont’)

Page 24: Principles of Computer Architecturemhtay/CPSC352/ITEC352_Power_Point/Ch06POCA.pdf · Department of Information Technology, Radford University ITEC 352 Computer Organization The Fetch-Execute

6-24 Chapter 6 - Datapath and Control

Department of Information Technology, Radford University ITEC 352 Computer Organization

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

set. subcc uses the Arithmetic format and op3 = 001100.

Page 25: Principles of Computer Architecturemhtay/CPSC352/ITEC352_Power_Point/Ch06POCA.pdf · Department of Information Technology, Radford University ITEC 352 Computer Organization The Fetch-Execute

6-25 Chapter 6 - Datapath and Control

Department of Information Technology, Radford University ITEC 352 Computer Organization

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

Page 26: Principles of Computer Architecturemhtay/CPSC352/ITEC352_Power_Point/Ch06POCA.pdf · Department of Information Technology, Radford University ITEC 352 Computer Organization The Fetch-Execute

6-26 Chapter 6 - Datapath and Control

Department of Information Technology, Radford University ITEC 352 Computer Organization

Microprogramming vs. Nanoprogramming

• (a) Micropro-gramming vs. (b) nano-programming.

Page 27: Principles of Computer Architecturemhtay/CPSC352/ITEC352_Power_Point/Ch06POCA.pdf · Department of Information Technology, Radford University ITEC 352 Computer Organization The Fetch-Execute

6-27 Chapter 6 - Datapath and Control

Department of Information Technology, Radford University ITEC 352 Computer Organization

Hardware Description Language

• HDL sequence for a resettablemodulo 4 counter.

Page 28: Principles of Computer Architecturemhtay/CPSC352/ITEC352_Power_Point/Ch06POCA.pdf · Department of Information Technology, Radford University ITEC 352 Computer Organization The Fetch-Execute

6-28 Chapter 6 - Datapath and Control

Department of Information Technology, Radford University ITEC 352 Computer Organization

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

Page 29: Principles of Computer Architecturemhtay/CPSC352/ITEC352_Power_Point/Ch06POCA.pdf · Department of Information Technology, Radford University ITEC 352 Computer Organization The Fetch-Execute

6-29 Chapter 6 - Datapath and Control

Department of Information Technology, Radford University ITEC 352 Computer Organization

HDL for ARC

• HDL description of the ARC control unit.

Page 30: Principles of Computer Architecturemhtay/CPSC352/ITEC352_Power_Point/Ch06POCA.pdf · Department of Information Technology, Radford University ITEC 352 Computer Organization The Fetch-Execute

6-30 Chapter 6 - Datapath and Control

Department of Information Technology, Radford University ITEC 352 Computer Organization

HDL for ARC (cont’)

Page 31: Principles of Computer Architecturemhtay/CPSC352/ITEC352_Power_Point/Ch06POCA.pdf · Department of Information Technology, Radford University ITEC 352 Computer Organization The Fetch-Execute

6-31 Chapter 6 - Datapath and Control

Department of Information Technology, Radford University ITEC 352 Computer Organization

HDL ARC Circuit

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

Page 32: Principles of Computer Architecturemhtay/CPSC352/ITEC352_Power_Point/Ch06POCA.pdf · Department of Information Technology, Radford University ITEC 352 Computer Organization The Fetch-Execute

6-32 Chapter 6 - Datapath and Control

Department of Information Technology, Radford University ITEC 352 Computer Organization

HDL ARC Circuit (cont’)• Hardwired

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

Page 33: Principles of Computer Architecturemhtay/CPSC352/ITEC352_Power_Point/Ch06POCA.pdf · Department of Information Technology, Radford University ITEC 352 Computer Organization The Fetch-Execute

6-33 Chapter 6 - Datapath and Control

Department of Information Technology, Radford University ITEC 352 Computer Organization

Case Study: The VHDL Hardware Description Language

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

Page 34: Principles of Computer Architecturemhtay/CPSC352/ITEC352_Power_Point/Ch06POCA.pdf · Department of Information Technology, Radford University ITEC 352 Computer Organization The Fetch-Execute

6-34 Chapter 6 - Datapath and Control

Department of Information Technology, Radford University ITEC 352 Computer Organization

VHDL SpecificationInterface specification for the majority component

--Interface

entity 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 is

begin

--compute the output using a Boolean expression

F_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 35: Principles of Computer Architecturemhtay/CPSC352/ITEC352_Power_Point/Ch06POCA.pdf · Department of Information Technology, Radford University ITEC 352 Computer Organization The Fetch-Execute

6-35 Chapter 6 - Datapath and Control

Department of Information Technology, Radford University ITEC 352 Computer Organization

VHDL Specification (cont’)-- Package declaration, in library WORK

package LOGIC_GATES is

component 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;

--Interface

entity MAJORITY is

port

(A_IN, B_IN, C_IN: in BIT

F_OUT: out BIT);

end MAJORITY;

Page 36: Principles of Computer Architecturemhtay/CPSC352/ITEC352_Power_Point/Ch06POCA.pdf · Department of Information Technology, Radford University ITEC 352 Computer Organization The Fetch-Execute

6-36 Chapter 6 - Datapath and Control

Department of Information Technology, Radford University ITEC 352 Computer Organization

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;