SlideShare a Scribd company logo
Chapter3 Notes: Hennessy | Arithmetic for Computers 1
Chapter 4 (Hennessy 4th Ed): The Processor
Supplement(s):
Outline:
 Introduction
 Logic DesignConventions
 Building a Datapath
 A Simple Implementation Scheme
 An Overview of Pipelining
 Pipelined Datapath and Control
 Data Hazards: Forwarding versus Stalling
 Control Hazards
 Exceptions
 Parallelism and Advanced Instruction-Level Parallelism
 Fallacies and Pitfalls
 Concluding Remarks
Content
INTRODUCTION
Chapter 1 explains that the performance of a computer is determinedbythree keyfactors:instructioncount, clock cycle time, and clockcycles per instruction
(CPI). Chapter 2 explains that the compiler andthe instructionset architecture determine the instructioncount requiredfor a given program. However, the
implementationof the processor determines boththe clockcycle time andthe number of clock cycles per instruction. Inthis chapter, we construct the
datapathandcontrol unit for two different implementations of the MIPS instructionset. This chapter contains anexplanationof the principlesandtechniques
usedinimplementing a processor, starting witha highlyabstract andsimplifiedoverview in this section. It is followedby a sectionthat buildsup a datapath
and constructs a simple versionof a processor sufficient to implement aninstructionset like MIPS. The bulk ofthe chapter covers a more realistic pipelined
MIPS implementation, followed bya sectionthat develops the concepts necessaryto implement more complex instructionsets, l ike the x86.
A Basic MIPS Implementation – We will be examining an implementationthat includes a subset of the core MIPS instructionset:
 The memory-reference instructions loadword(lw) and store word (sw)
 The arithmetic-logical instructions add,sub,AND,OR, and slt
 The instructions branchequal (beq)andjump(j), whichwe addlast
This subset doesnot include all the integer instructions (for example, shift, multiply, anddivide are missing), nor does it include anyfloating-point instructions.
However, the keyprinciplesusedincreating a datapathanddesigningthe control are illustrated. The implementationof the remaining instructions is similar.
In examiningthe implementation, we willhave the opportunityto see how the instructionset architecture determines manyaspects ofthe implementation,
and howthe choice ofvarious implementation strategies affects the clock rate and CPI for the computer. Manyof the keydesign principles introducedin
Chapter 1 can be illustratedbylooking at the implementation, suchas the guidelines Make the common case fast and Simplicityfavors regularity. In addition,
most concepts usedto implement the MIPS subset inthis chapter are the same basic ideas that are used to construct a broads pectrumof computers, from
high-performance servers to general- purpose microprocessors to embeddedprocessors.
An Overview of the Implementation – For everyinstruction, the first twosteps are identical:1) Sendthe program counter (PC) to the memorythat contains
the code and fetch the instructionfrom that memory. 2) Readone or two registers, usingfields of the instructionto select the registers to read. For the load
word instruction, we needto readonlyone register, but most other instructions require that we readtwo registers.
After these two steps, the actions requiredto complete the instruction depend onthe instruction class. Fortunately, for eachof the three instructionclasses
(memory-reference, arithmetic-logical, and branches), the actions are largelythe same, independent of the exact instruction. The simplicityand regularity of
the MIPS instruction set simplifies the implementation bymakingthe executionof manyof the instructionclasses similar. For example, allinstruction classes,
except jump, use the arithmetic-logical unit (ALU) after reading the registers. The memory-reference instructions use the ALU for anaddress calculation, the
arithmetic-logical instructions for the operationexecution, and branches for comparison. After using the ALU, the actions required to complete various
instruction classes differ. A memory-reference instructionwill needto accessthe memoryeither to readdata for a load or write data for a store. An
arithmetic-logical or loadinstruction must write the data fromthe ALU or memorybackintoa register. Lastly, for a branchinstruction, we mayneed to change
the next instructionaddress basedon the comparison;otherwise, the PCshouldbe incrementedby4 to get the address of the next instruction.
Chapter3 Notes: Hennessy | Arithmetic for Computers 2
FIGURE4.1 An abstract view ofthe implementation ofthe MIPS subset showing the major functional units
and the major connectionsbetween them. Allinstructions startby using theprogram counter to supply the
instruction address to the instruction memory.After theinstructionis fetched,theregister operands used by
an instruction are specified by fields ofthat instruction. Once the registeroperands have been fetched, they
can be operated onto computea memory address (for a load or store), to computean arithmetic result (for
an integer arithmetic-logicalinstruction),or a compare (for a branch). Iftheinstructionis an arithmetic-logical
instruction, theresult fromtheALU mustbe written to a register. Ifthe operation is a load or store, the ALU
result is used as an address to either store a valuefrom the registers or load a value from memory into the
registers. The result fromtheALU or memory is writtenback intotheregister file. Branches requiretheuse of
the ALU outputto determinethe nextinstruction address, which comes either from the ALU (where the PC
and branch offset aresummed) or from an adder that increments thecurrent PC by 4. The thick lines interconnecting the funct ional units represent buses, which consist of
multiplesignals. The arrows are used toguide the reader inknowing how information flows. Sincesignallines may cross, weexplicitly showwhen crossing lines areconnected by
the presence of a dot where the lines cross.
Figure 4.1 shows thehigh-levelview ofa MIPS implementation, focusing onthevarious functionalunits and their interconnection.Althoughthis figureshows most ofthe flow of
data through theprocessor, itomits twoimportant aspects ofinstructionexecution. First, inseveral places, Figure4.1shows data going to a particular unit as coming from two
different sources.For example, thevalue written into thePC can comefrom one oftwoadders, the data written intotheregister file can come from either the ALU or the data
memory, and thesecond inputto theALU cancomefroma register ortheimmediate field oftheinstruction.In practice, these data lines cannot simply be wired together; we
must add a logic elementthatchooses fromamong the multiplesources andsteers oneofthosesources to its destination. This selectionis commonly donewitha devicecalled a
multiplexor, although this devicemight betterbe called a data selector. Appendix C describes themultiplexor,whichselects from among several inputs basedon thesetting ofits
control lines. The control lines are set based primarily on information taken from the
instruction being executed.
The secondomissionin Figure4.1is that several oftheunits mustbe controlleddepending on
the type ofinstruction. For example,the data memory must read on a load and write on a
store. The registerfilemustbe written on a loadandanarithmetic-logicalinstruction.And, of
course, the ALUmust perform oneofseveraloperations,as wesaw inChapter2. (AppendixC
describes the detailed designof theALU.) Like the multiplexors, theseoperations aredirected
by control lines that are set on the basis ofvarious fields in the instruction.
FIGURE 4.2 The basic implementation of the MIPS subset, including the necessary
multiplexorsand control lines. Thetop multiplexor (“Mux”) controls whatvaluereplaces the
PC (PC +4 or the branch destinationaddress); themultiplexor is controlled by the gate that
“ANDs” together the Zero output ofthe ALU and a control signal that indicates that the
instruction is a branch. Themiddle multiplexor, whoseoutput returns to the register file, is
used to steer the output of theALU (in thecase ofan arithmetic-logical instruction) or the
output ofthe data memory (inthecase ofa load) for writing into theregister file. Finally, the
bottom most multiplexor is used to determine whether the second ALU input is from the
registers (for an arithmetic-logical instruction OR a branch) or from the offset field ofthe
instruction (for a load or store). The added controllines arestraightforward and determine
the operation performed at the ALU, whether the data memory should read or write, and
whether the registers should perform a write operation. The control lines are shown in color to make them easier to see.
Figure 4.2 shows thedatapathof Figure4.1 with thethreerequired multiplexors added, as well as control lines for the major functional units. A control unit, which has the
instruction as an input, is used todeterminehow toset the controllines for thefunctional units and twoofthe multiplexors. Thethird multiplexor, which determines whether PC
+ 4 or the branchdestination address is written into the PC, is set based on the Zero output ofthe ALU, which is used to pe rform the comparison ofa beq instruction. The
regularity and simplicity of the MIPS instruction set means that a simple decoding process can be used to determine how to set the c ontrol lines.
In the remainder of thechapter, werefinethis view to fill inthedetails, which requires that weadd further functionalunits, increasethenumber ofconnections between units,
and, ofcourse,enhance a control unitto control what actions aretaken for differentinstruction classes. Sections 4.3and 4.4 describea simpleimplementationthat uses a single
long clock cyclefor every instruction and follows thegeneralform ofFigures 4.1and4.2. Inthis firstdesign, every instructionbegins execution on oneclock edge and completes
execution onthenext clock edge.Whileeasier tounderstand,this approach is not practical,since the clock cyclemustbe stretchedto accommodatethelongestinstruction. After
designing the control for this simple computer, we will look at pipelined implementation with all its complexities, including exceptions.
LOGIC DESIGN CONVENTIONS
This section reviews a few keyideas in digitallogic that wewill useextensively inthis chapter. The datapathelements in theMIPS implementationconsist oftwo differenttypes of
logic elements: elements that operateon data values andelements thatcontainstate. The elements thatoperateon data values areallcombinational(An operational element,
such as an AND gateor an ALU.), which means thattheiroutputs depend only on thecurrent inputs. Giventhesame input, a combinational element always produces the same
output. The ALU shown inFigure 4.1 is an exampleofa combinational element. Givena setofinputs, it always produces the s ame output because it has no internal storage.
Other elements in the designarenotcombinational,but instead contain state. An elementcontains state ifit has someinternal storage.We call theseelements state elements(A
memory element, such as a register or a memory.) because, ifwepulled the power plug on the computer, wecould restartit by loading the stateelements wi th the values they
containedbefore wepulledtheplug. Furthermore, ifwesaved andrestored thestateelements,it wouldbeas if thecomputer had never lostpower.Thus, thesestate elements
completely characterize the computer. In Figure 4.1, the instruction and data memories, as well as the registers, are all exa mples ofstate elements.
A stateelement has atleasttwo inputs and one output.The required inputs are the data valueto bewritteninto theelement and the clock, which determines when the da ta
value is written.The output froma stateelement provides thevaluethatwas written inanearlier clock cycle. For example, one ofthe logically simplest stateelements is a D-type
flip-flop, which has exactly thesetwo inputs (a value anda clock) andoneoutput. Inaddition to flip-flops, our MIPS implementation also uses two other types ofstate elements:
memories andregisters, both of whichappear in Figure4.1. Theclock is used todeterminewhen the state elementshould bewritten; a state element can be read at any time.
Logic components that contain stateare alsocalled sequential, becausetheir outputs depend onboththeirinputs and thecontents oftheinternalstate. For example, the output
from the functional unit representing the registers depends both on the register numbers supplied and on what was written int o the registers previously.
Chapter3 Notes: Hennessy | Arithmetic for Computers 3
We will use the word asserted (The signal is logically highor true) toindicatea signalthat is logically high and assertto specify that a signal should be driven logically high, and
deassert or deasserted (The signal is logically low or false) to represent logically low.
AssociatedContent
 XXX
To Be Cleared
Further Reading
 XXX
More Research
 XXX

More Related Content

What's hot

Datapath Design of Computer Architecture
Datapath Design of Computer ArchitectureDatapath Design of Computer Architecture
Datapath Design of Computer Architecture
Abu Zaman
 
Chapter1-Introduction.pdf
Chapter1-Introduction.pdfChapter1-Introduction.pdf
Chapter1-Introduction.pdf
GhulamHussain142878
 
Unit 2
Unit 2Unit 2
THE PROCESSOR
THE PROCESSORTHE PROCESSOR
THE PROCESSOR
Jai Sudhan
 
Memory Reference Instructions
Memory Reference InstructionsMemory Reference Instructions
Memory Reference Instructions
Rabin BK
 
Pipelining and vector processing
Pipelining and vector processingPipelining and vector processing
Pipelining and vector processing
Kamal Acharya
 
Register transfer and micro-operation
Register transfer and micro-operationRegister transfer and micro-operation
Register transfer and micro-operation
Nikhil Pandit
 
Ch8 (1) morris mano
Ch8 (1) morris manoCh8 (1) morris mano
Ch8 (1) morris mano
KIRTI89
 
Coa module2
Coa module2Coa module2
Coa module2
cs19club
 
Unit 4-input-output organization
Unit 4-input-output organizationUnit 4-input-output organization
Unit 4-input-output organization
vishal choudhary
 
Chapter 9
Chapter 9Chapter 9
MCA-I-COA- overview of register transfer, micro operations and basic computer...
MCA-I-COA- overview of register transfer, micro operations and basic computer...MCA-I-COA- overview of register transfer, micro operations and basic computer...
MCA-I-COA- overview of register transfer, micro operations and basic computer...
Rai University
 
Computer organization basics
Computer organization  basicsComputer organization  basics
Computer organization basics
Deepak John
 
Bca 2nd sem-u-2.1-overview of register transfer, micro operations and basic c...
Bca 2nd sem-u-2.1-overview of register transfer, micro operations and basic c...Bca 2nd sem-u-2.1-overview of register transfer, micro operations and basic c...
Bca 2nd sem-u-2.1-overview of register transfer, micro operations and basic c...
Rai University
 
Basic MIPS implementation
Basic MIPS implementationBasic MIPS implementation
Basic MIPS implementation
kavitha2009
 
310471266 chapter-7-notes-computer-organization
310471266 chapter-7-notes-computer-organization310471266 chapter-7-notes-computer-organization
310471266 chapter-7-notes-computer-organization
srinoni
 
COMPUTER ORGANIZATION NOTES Unit 2
COMPUTER ORGANIZATION NOTES  Unit 2COMPUTER ORGANIZATION NOTES  Unit 2
COMPUTER ORGANIZATION NOTES Unit 2
Dr.MAYA NAYAK
 

What's hot (19)

Datapath Design of Computer Architecture
Datapath Design of Computer ArchitectureDatapath Design of Computer Architecture
Datapath Design of Computer Architecture
 
Chapter1-Introduction.pdf
Chapter1-Introduction.pdfChapter1-Introduction.pdf
Chapter1-Introduction.pdf
 
Bc0040
Bc0040Bc0040
Bc0040
 
Unit 2
Unit 2Unit 2
Unit 2
 
THE PROCESSOR
THE PROCESSORTHE PROCESSOR
THE PROCESSOR
 
Memory Reference Instructions
Memory Reference InstructionsMemory Reference Instructions
Memory Reference Instructions
 
Pipelining and vector processing
Pipelining and vector processingPipelining and vector processing
Pipelining and vector processing
 
J1067783
J1067783J1067783
J1067783
 
Register transfer and micro-operation
Register transfer and micro-operationRegister transfer and micro-operation
Register transfer and micro-operation
 
Ch8 (1) morris mano
Ch8 (1) morris manoCh8 (1) morris mano
Ch8 (1) morris mano
 
Coa module2
Coa module2Coa module2
Coa module2
 
Unit 4-input-output organization
Unit 4-input-output organizationUnit 4-input-output organization
Unit 4-input-output organization
 
Chapter 9
Chapter 9Chapter 9
Chapter 9
 
MCA-I-COA- overview of register transfer, micro operations and basic computer...
MCA-I-COA- overview of register transfer, micro operations and basic computer...MCA-I-COA- overview of register transfer, micro operations and basic computer...
MCA-I-COA- overview of register transfer, micro operations and basic computer...
 
Computer organization basics
Computer organization  basicsComputer organization  basics
Computer organization basics
 
Bca 2nd sem-u-2.1-overview of register transfer, micro operations and basic c...
Bca 2nd sem-u-2.1-overview of register transfer, micro operations and basic c...Bca 2nd sem-u-2.1-overview of register transfer, micro operations and basic c...
Bca 2nd sem-u-2.1-overview of register transfer, micro operations and basic c...
 
Basic MIPS implementation
Basic MIPS implementationBasic MIPS implementation
Basic MIPS implementation
 
310471266 chapter-7-notes-computer-organization
310471266 chapter-7-notes-computer-organization310471266 chapter-7-notes-computer-organization
310471266 chapter-7-notes-computer-organization
 
COMPUTER ORGANIZATION NOTES Unit 2
COMPUTER ORGANIZATION NOTES  Unit 2COMPUTER ORGANIZATION NOTES  Unit 2
COMPUTER ORGANIZATION NOTES Unit 2
 

Viewers also liked

MANUAL PARA INSCRIBIR UN CLUB NUEVO EN RI
MANUAL PARA INSCRIBIR UN CLUB NUEVO EN RIMANUAL PARA INSCRIBIR UN CLUB NUEVO EN RI
MANUAL PARA INSCRIBIR UN CLUB NUEVO EN RI
JUAN CONTRERAS CACERES
 
Como nace la fundacion rotaria
Como nace la fundacion rotariaComo nace la fundacion rotaria
Como nace la fundacion rotaria
JUAN CONTRERAS CACERES
 
HSA 599 WEEK 1 DISCUSSION 2
HSA 599 WEEK 1 DISCUSSION 2HSA 599 WEEK 1 DISCUSSION 2
HSA 599 WEEK 1 DISCUSSION 2hwacer123
 
Otro +el equipo
Otro +el equipoOtro +el equipo
Otro +el equipo
elpetru
 
從珠寶看個性
從珠寶看個性從珠寶看個性
從珠寶看個性
neo423
 
PIONEER PARK
PIONEER PARKPIONEER PARK
PIONEER PARK
Realatix Consulting
 
Ansal sovereign floors Gurgaon Sector 66 Golf Course Road Extension Road
Ansal sovereign floors Gurgaon Sector 66 Golf Course Road Extension RoadAnsal sovereign floors Gurgaon Sector 66 Golf Course Road Extension Road
Ansal sovereign floors Gurgaon Sector 66 Golf Course Road Extension Road
Realatix Consulting
 
Land use change map
Land use change mapLand use change map
Land use change map
Rose Funja
 
Geometrie descriptiva si perspectiva mircea enache iulius
Geometrie descriptiva si perspectiva mircea enache   iulius Geometrie descriptiva si perspectiva mircea enache   iulius
Geometrie descriptiva si perspectiva mircea enache iulius
Andreea Elena Cîrlan
 
4th Semester M Tech: VLSI Design and Embedded System (June-2016) Question Papers
4th Semester M Tech: VLSI Design and Embedded System (June-2016) Question Papers4th Semester M Tech: VLSI Design and Embedded System (June-2016) Question Papers
4th Semester M Tech: VLSI Design and Embedded System (June-2016) Question Papers
BGS Institute of Technology, Adichunchanagiri University (ACU)
 
The value of digital out-of-home
The value of digital out-of-homeThe value of digital out-of-home
The value of digital out-of-home
Posterscope
 

Viewers also liked (12)

MANUAL PARA INSCRIBIR UN CLUB NUEVO EN RI
MANUAL PARA INSCRIBIR UN CLUB NUEVO EN RIMANUAL PARA INSCRIBIR UN CLUB NUEVO EN RI
MANUAL PARA INSCRIBIR UN CLUB NUEVO EN RI
 
Como nace la fundacion rotaria
Como nace la fundacion rotariaComo nace la fundacion rotaria
Como nace la fundacion rotaria
 
HSA 599 WEEK 1 DISCUSSION 2
HSA 599 WEEK 1 DISCUSSION 2HSA 599 WEEK 1 DISCUSSION 2
HSA 599 WEEK 1 DISCUSSION 2
 
Otro +el equipo
Otro +el equipoOtro +el equipo
Otro +el equipo
 
從珠寶看個性
從珠寶看個性從珠寶看個性
從珠寶看個性
 
PIONEER PARK
PIONEER PARKPIONEER PARK
PIONEER PARK
 
Ansal sovereign floors Gurgaon Sector 66 Golf Course Road Extension Road
Ansal sovereign floors Gurgaon Sector 66 Golf Course Road Extension RoadAnsal sovereign floors Gurgaon Sector 66 Golf Course Road Extension Road
Ansal sovereign floors Gurgaon Sector 66 Golf Course Road Extension Road
 
Land use change map
Land use change mapLand use change map
Land use change map
 
sppt
spptsppt
sppt
 
Geometrie descriptiva si perspectiva mircea enache iulius
Geometrie descriptiva si perspectiva mircea enache   iulius Geometrie descriptiva si perspectiva mircea enache   iulius
Geometrie descriptiva si perspectiva mircea enache iulius
 
4th Semester M Tech: VLSI Design and Embedded System (June-2016) Question Papers
4th Semester M Tech: VLSI Design and Embedded System (June-2016) Question Papers4th Semester M Tech: VLSI Design and Embedded System (June-2016) Question Papers
4th Semester M Tech: VLSI Design and Embedded System (June-2016) Question Papers
 
The value of digital out-of-home
The value of digital out-of-homeThe value of digital out-of-home
The value of digital out-of-home
 

Similar to Hennchthree

Chapter 04 the processor
Chapter 04   the processorChapter 04   the processor
Chapter 04 the processorBảo Hoang
 
Operating system
Operating systemOperating system
Operating system
raj732723
 
Unit iii
Unit iiiUnit iii
Unit iii
Janani S
 
11.[10 14]dynamic instruction scheduling for microprocessors having out of or...
11.[10 14]dynamic instruction scheduling for microprocessors having out of or...11.[10 14]dynamic instruction scheduling for microprocessors having out of or...
11.[10 14]dynamic instruction scheduling for microprocessors having out of or...
Alexander Decker
 
Fpga implementation of a functional microcontroller
Fpga implementation of a functional microcontrollerFpga implementation of a functional microcontroller
Fpga implementation of a functional microcontroller
eSAT Publishing House
 
MIPS IMPLEMENTATION.pptx
MIPS IMPLEMENTATION.pptxMIPS IMPLEMENTATION.pptx
MIPS IMPLEMENTATION.pptx
JEEVANANTHAMG6
 
DG M 4 ppt.pptx
DG M 4 ppt.pptxDG M 4 ppt.pptx
DG M 4 ppt.pptx
Jumana74
 
11.dynamic instruction scheduling for microprocessors having out of order exe...
11.dynamic instruction scheduling for microprocessors having out of order exe...11.dynamic instruction scheduling for microprocessors having out of order exe...
11.dynamic instruction scheduling for microprocessors having out of order exe...Alexander Decker
 
16-bit Microprocessor Design (2005)
16-bit Microprocessor Design (2005)16-bit Microprocessor Design (2005)
16-bit Microprocessor Design (2005)
Susam Pal
 
Bindura university of science education
Bindura university of science educationBindura university of science education
Bindura university of science education
Innocent Tauzeni
 
03. top level view of computer function & interconnection
03. top level view of computer function & interconnection03. top level view of computer function & interconnection
03. top level view of computer function & interconnection
noman yasin
 
Addressing modes (detailed data path)
Addressing modes (detailed data path)Addressing modes (detailed data path)
Addressing modes (detailed data path)Mahesh Kumar Attri
 
Bca examination 2015 csa
Bca examination 2015 csaBca examination 2015 csa
Bca examination 2015 csa
Anjaan Gajendra
 
Matter new
Matter newMatter new
Matter new
kanagasabai12
 
pdfslide.net_morris-mano-ppt.ppt
pdfslide.net_morris-mano-ppt.pptpdfslide.net_morris-mano-ppt.ppt
pdfslide.net_morris-mano-ppt.ppt
SaurabhPorwal14
 
CS6303 Computer Architecture.pdf
CS6303 Computer Architecture.pdfCS6303 Computer Architecture.pdf
CS6303 Computer Architecture.pdf
187SayanBhattacharje
 
Different addressing mode and risc, cisc microprocessor
Different addressing mode and risc, cisc microprocessorDifferent addressing mode and risc, cisc microprocessor
Different addressing mode and risc, cisc microprocessor
Daffodil International University
 
U proc ovw
U proc ovwU proc ovw
U proc ovw
Brit4
 
Pipeline Computing by S. M. Risalat Hasan Chowdhury
Pipeline Computing by S. M. Risalat Hasan ChowdhuryPipeline Computing by S. M. Risalat Hasan Chowdhury
Pipeline Computing by S. M. Risalat Hasan Chowdhury
S. M. Risalat Hasan Chowdhury
 
Computer engineering - overview of microprocessors
Computer engineering - overview of microprocessorsComputer engineering - overview of microprocessors
Computer engineering - overview of microprocessors
EkeedaPvtLtd
 

Similar to Hennchthree (20)

Chapter 04 the processor
Chapter 04   the processorChapter 04   the processor
Chapter 04 the processor
 
Operating system
Operating systemOperating system
Operating system
 
Unit iii
Unit iiiUnit iii
Unit iii
 
11.[10 14]dynamic instruction scheduling for microprocessors having out of or...
11.[10 14]dynamic instruction scheduling for microprocessors having out of or...11.[10 14]dynamic instruction scheduling for microprocessors having out of or...
11.[10 14]dynamic instruction scheduling for microprocessors having out of or...
 
Fpga implementation of a functional microcontroller
Fpga implementation of a functional microcontrollerFpga implementation of a functional microcontroller
Fpga implementation of a functional microcontroller
 
MIPS IMPLEMENTATION.pptx
MIPS IMPLEMENTATION.pptxMIPS IMPLEMENTATION.pptx
MIPS IMPLEMENTATION.pptx
 
DG M 4 ppt.pptx
DG M 4 ppt.pptxDG M 4 ppt.pptx
DG M 4 ppt.pptx
 
11.dynamic instruction scheduling for microprocessors having out of order exe...
11.dynamic instruction scheduling for microprocessors having out of order exe...11.dynamic instruction scheduling for microprocessors having out of order exe...
11.dynamic instruction scheduling for microprocessors having out of order exe...
 
16-bit Microprocessor Design (2005)
16-bit Microprocessor Design (2005)16-bit Microprocessor Design (2005)
16-bit Microprocessor Design (2005)
 
Bindura university of science education
Bindura university of science educationBindura university of science education
Bindura university of science education
 
03. top level view of computer function & interconnection
03. top level view of computer function & interconnection03. top level view of computer function & interconnection
03. top level view of computer function & interconnection
 
Addressing modes (detailed data path)
Addressing modes (detailed data path)Addressing modes (detailed data path)
Addressing modes (detailed data path)
 
Bca examination 2015 csa
Bca examination 2015 csaBca examination 2015 csa
Bca examination 2015 csa
 
Matter new
Matter newMatter new
Matter new
 
pdfslide.net_morris-mano-ppt.ppt
pdfslide.net_morris-mano-ppt.pptpdfslide.net_morris-mano-ppt.ppt
pdfslide.net_morris-mano-ppt.ppt
 
CS6303 Computer Architecture.pdf
CS6303 Computer Architecture.pdfCS6303 Computer Architecture.pdf
CS6303 Computer Architecture.pdf
 
Different addressing mode and risc, cisc microprocessor
Different addressing mode and risc, cisc microprocessorDifferent addressing mode and risc, cisc microprocessor
Different addressing mode and risc, cisc microprocessor
 
U proc ovw
U proc ovwU proc ovw
U proc ovw
 
Pipeline Computing by S. M. Risalat Hasan Chowdhury
Pipeline Computing by S. M. Risalat Hasan ChowdhuryPipeline Computing by S. M. Risalat Hasan Chowdhury
Pipeline Computing by S. M. Risalat Hasan Chowdhury
 
Computer engineering - overview of microprocessors
Computer engineering - overview of microprocessorsComputer engineering - overview of microprocessors
Computer engineering - overview of microprocessors
 

More from marangburu42

Hol
HolHol
Write miss
Write missWrite miss
Write miss
marangburu42
 
Hennchthree 161102111515
Hennchthree 161102111515Hennchthree 161102111515
Hennchthree 161102111515
marangburu42
 
Hennchthree
HennchthreeHennchthree
Hennchthree
marangburu42
 
Sequential circuits
Sequential circuitsSequential circuits
Sequential circuits
marangburu42
 
Combinational circuits
Combinational circuitsCombinational circuits
Combinational circuits
marangburu42
 
Hennchthree 160912095304
Hennchthree 160912095304Hennchthree 160912095304
Hennchthree 160912095304
marangburu42
 
Sequential circuits
Sequential circuitsSequential circuits
Sequential circuits
marangburu42
 
Combinational circuits
Combinational circuitsCombinational circuits
Combinational circuits
marangburu42
 
Karnaugh mapping allaboutcircuits
Karnaugh mapping allaboutcircuitsKarnaugh mapping allaboutcircuits
Karnaugh mapping allaboutcircuits
marangburu42
 
Aac boolean formulae
Aac   boolean formulaeAac   boolean formulae
Aac boolean formulae
marangburu42
 
Virtualmemoryfinal 161019175858
Virtualmemoryfinal 161019175858Virtualmemoryfinal 161019175858
Virtualmemoryfinal 161019175858
marangburu42
 
Io systems final
Io systems finalIo systems final
Io systems final
marangburu42
 
File system interfacefinal
File system interfacefinalFile system interfacefinal
File system interfacefinal
marangburu42
 
File systemimplementationfinal
File systemimplementationfinalFile systemimplementationfinal
File systemimplementationfinal
marangburu42
 
Mass storage structurefinal
Mass storage structurefinalMass storage structurefinal
Mass storage structurefinal
marangburu42
 
All aboutcircuits karnaugh maps
All aboutcircuits karnaugh mapsAll aboutcircuits karnaugh maps
All aboutcircuits karnaugh maps
marangburu42
 
Virtual memoryfinal
Virtual memoryfinalVirtual memoryfinal
Virtual memoryfinal
marangburu42
 
Mainmemoryfinal 161019122029
Mainmemoryfinal 161019122029Mainmemoryfinal 161019122029
Mainmemoryfinal 161019122029
marangburu42
 
Virtualmemorypre final-formatting-161019022904
Virtualmemorypre final-formatting-161019022904Virtualmemorypre final-formatting-161019022904
Virtualmemorypre final-formatting-161019022904
marangburu42
 

More from marangburu42 (20)

Hol
HolHol
Hol
 
Write miss
Write missWrite miss
Write miss
 
Hennchthree 161102111515
Hennchthree 161102111515Hennchthree 161102111515
Hennchthree 161102111515
 
Hennchthree
HennchthreeHennchthree
Hennchthree
 
Sequential circuits
Sequential circuitsSequential circuits
Sequential circuits
 
Combinational circuits
Combinational circuitsCombinational circuits
Combinational circuits
 
Hennchthree 160912095304
Hennchthree 160912095304Hennchthree 160912095304
Hennchthree 160912095304
 
Sequential circuits
Sequential circuitsSequential circuits
Sequential circuits
 
Combinational circuits
Combinational circuitsCombinational circuits
Combinational circuits
 
Karnaugh mapping allaboutcircuits
Karnaugh mapping allaboutcircuitsKarnaugh mapping allaboutcircuits
Karnaugh mapping allaboutcircuits
 
Aac boolean formulae
Aac   boolean formulaeAac   boolean formulae
Aac boolean formulae
 
Virtualmemoryfinal 161019175858
Virtualmemoryfinal 161019175858Virtualmemoryfinal 161019175858
Virtualmemoryfinal 161019175858
 
Io systems final
Io systems finalIo systems final
Io systems final
 
File system interfacefinal
File system interfacefinalFile system interfacefinal
File system interfacefinal
 
File systemimplementationfinal
File systemimplementationfinalFile systemimplementationfinal
File systemimplementationfinal
 
Mass storage structurefinal
Mass storage structurefinalMass storage structurefinal
Mass storage structurefinal
 
All aboutcircuits karnaugh maps
All aboutcircuits karnaugh mapsAll aboutcircuits karnaugh maps
All aboutcircuits karnaugh maps
 
Virtual memoryfinal
Virtual memoryfinalVirtual memoryfinal
Virtual memoryfinal
 
Mainmemoryfinal 161019122029
Mainmemoryfinal 161019122029Mainmemoryfinal 161019122029
Mainmemoryfinal 161019122029
 
Virtualmemorypre final-formatting-161019022904
Virtualmemorypre final-formatting-161019022904Virtualmemorypre final-formatting-161019022904
Virtualmemorypre final-formatting-161019022904
 

Recently uploaded

一比一原版(UniSA毕业证)南澳大学毕业证成绩单如何办理
一比一原版(UniSA毕业证)南澳大学毕业证成绩单如何办理一比一原版(UniSA毕业证)南澳大学毕业证成绩单如何办理
一比一原版(UniSA毕业证)南澳大学毕业证成绩单如何办理
zeyhe
 
2137ad - Characters that live in Merindol and are at the center of main stories
2137ad - Characters that live in Merindol and are at the center of main stories2137ad - Characters that live in Merindol and are at the center of main stories
2137ad - Characters that live in Merindol and are at the center of main stories
luforfor
 
Memory Rental Store - The Ending(Storyboard)
Memory Rental Store - The Ending(Storyboard)Memory Rental Store - The Ending(Storyboard)
Memory Rental Store - The Ending(Storyboard)
SuryaKalyan3
 
一比一原版(DU毕业证)迪肯大学毕业证成绩单
一比一原版(DU毕业证)迪肯大学毕业证成绩单一比一原版(DU毕业证)迪肯大学毕业证成绩单
一比一原版(DU毕业证)迪肯大学毕业证成绩单
zvaywau
 
一比一原版(qut毕业证)昆士兰科技大学毕业证如何办理
一比一原版(qut毕业证)昆士兰科技大学毕业证如何办理一比一原版(qut毕业证)昆士兰科技大学毕业证如何办理
一比一原版(qut毕业证)昆士兰科技大学毕业证如何办理
taqyed
 
ashokathegreat project class 12 presentation
ashokathegreat project class 12 presentationashokathegreat project class 12 presentation
ashokathegreat project class 12 presentation
aditiyad2020
 
Codes n Conventionss copy (2).pptx new new
Codes n Conventionss copy (2).pptx new newCodes n Conventionss copy (2).pptx new new
Codes n Conventionss copy (2).pptx new new
ZackSpencer3
 
一比一原版(GU毕业证)格里菲斯大学毕业证成绩单
一比一原版(GU毕业证)格里菲斯大学毕业证成绩单一比一原版(GU毕业证)格里菲斯大学毕业证成绩单
一比一原版(GU毕业证)格里菲斯大学毕业证成绩单
zvaywau
 
Memory Rental Store - The Chase (Storyboard)
Memory Rental Store - The Chase (Storyboard)Memory Rental Store - The Chase (Storyboard)
Memory Rental Store - The Chase (Storyboard)
SuryaKalyan3
 
The Last Polymath: Muntadher Saleh‎‎‎‎‎‎‎‎‎‎‎‎
The Last Polymath: Muntadher Saleh‎‎‎‎‎‎‎‎‎‎‎‎The Last Polymath: Muntadher Saleh‎‎‎‎‎‎‎‎‎‎‎‎
The Last Polymath: Muntadher Saleh‎‎‎‎‎‎‎‎‎‎‎‎
iraqartsandculture
 
Caffeinated Pitch Bible- developed by Claire Wilson
Caffeinated Pitch Bible- developed by Claire WilsonCaffeinated Pitch Bible- developed by Claire Wilson
Caffeinated Pitch Bible- developed by Claire Wilson
ClaireWilson398082
 
Inter-Dimensional Girl Boards Segment (Act 3)
Inter-Dimensional Girl Boards Segment (Act 3)Inter-Dimensional Girl Boards Segment (Act 3)
Inter-Dimensional Girl Boards Segment (Act 3)
CristianMestre
 
A Brief Introduction About Hadj Ounis
A Brief  Introduction  About  Hadj OunisA Brief  Introduction  About  Hadj Ounis
A Brief Introduction About Hadj Ounis
Hadj Ounis
 
ART FORMS OF KERALA: TRADITIONAL AND OTHERS
ART FORMS OF KERALA: TRADITIONAL AND OTHERSART FORMS OF KERALA: TRADITIONAL AND OTHERS
ART FORMS OF KERALA: TRADITIONAL AND OTHERS
Sandhya J.Nair
 
一比一原版(QUT毕业证)昆士兰科技大学毕业证成绩单如何办理
一比一原版(QUT毕业证)昆士兰科技大学毕业证成绩单如何办理一比一原版(QUT毕业证)昆士兰科技大学毕业证成绩单如何办理
一比一原版(QUT毕业证)昆士兰科技大学毕业证成绩单如何办理
zeyhe
 
acting board rough title here lolaaaaaaa
acting board rough title here lolaaaaaaaacting board rough title here lolaaaaaaa
acting board rough title here lolaaaaaaa
angelicafronda7
 
IrishWritersCtrsPersonalEssaysMay29.pptx
IrishWritersCtrsPersonalEssaysMay29.pptxIrishWritersCtrsPersonalEssaysMay29.pptx
IrishWritersCtrsPersonalEssaysMay29.pptx
Aine Greaney Ellrott
 
2137ad Merindol Colony Interiors where refugee try to build a seemengly norm...
2137ad  Merindol Colony Interiors where refugee try to build a seemengly norm...2137ad  Merindol Colony Interiors where refugee try to build a seemengly norm...
2137ad Merindol Colony Interiors where refugee try to build a seemengly norm...
luforfor
 
Fed by curiosity and beauty - Remembering Myrsine Zorba
Fed by curiosity and beauty - Remembering Myrsine ZorbaFed by curiosity and beauty - Remembering Myrsine Zorba
Fed by curiosity and beauty - Remembering Myrsine Zorba
mariavlachoupt
 

Recently uploaded (19)

一比一原版(UniSA毕业证)南澳大学毕业证成绩单如何办理
一比一原版(UniSA毕业证)南澳大学毕业证成绩单如何办理一比一原版(UniSA毕业证)南澳大学毕业证成绩单如何办理
一比一原版(UniSA毕业证)南澳大学毕业证成绩单如何办理
 
2137ad - Characters that live in Merindol and are at the center of main stories
2137ad - Characters that live in Merindol and are at the center of main stories2137ad - Characters that live in Merindol and are at the center of main stories
2137ad - Characters that live in Merindol and are at the center of main stories
 
Memory Rental Store - The Ending(Storyboard)
Memory Rental Store - The Ending(Storyboard)Memory Rental Store - The Ending(Storyboard)
Memory Rental Store - The Ending(Storyboard)
 
一比一原版(DU毕业证)迪肯大学毕业证成绩单
一比一原版(DU毕业证)迪肯大学毕业证成绩单一比一原版(DU毕业证)迪肯大学毕业证成绩单
一比一原版(DU毕业证)迪肯大学毕业证成绩单
 
一比一原版(qut毕业证)昆士兰科技大学毕业证如何办理
一比一原版(qut毕业证)昆士兰科技大学毕业证如何办理一比一原版(qut毕业证)昆士兰科技大学毕业证如何办理
一比一原版(qut毕业证)昆士兰科技大学毕业证如何办理
 
ashokathegreat project class 12 presentation
ashokathegreat project class 12 presentationashokathegreat project class 12 presentation
ashokathegreat project class 12 presentation
 
Codes n Conventionss copy (2).pptx new new
Codes n Conventionss copy (2).pptx new newCodes n Conventionss copy (2).pptx new new
Codes n Conventionss copy (2).pptx new new
 
一比一原版(GU毕业证)格里菲斯大学毕业证成绩单
一比一原版(GU毕业证)格里菲斯大学毕业证成绩单一比一原版(GU毕业证)格里菲斯大学毕业证成绩单
一比一原版(GU毕业证)格里菲斯大学毕业证成绩单
 
Memory Rental Store - The Chase (Storyboard)
Memory Rental Store - The Chase (Storyboard)Memory Rental Store - The Chase (Storyboard)
Memory Rental Store - The Chase (Storyboard)
 
The Last Polymath: Muntadher Saleh‎‎‎‎‎‎‎‎‎‎‎‎
The Last Polymath: Muntadher Saleh‎‎‎‎‎‎‎‎‎‎‎‎The Last Polymath: Muntadher Saleh‎‎‎‎‎‎‎‎‎‎‎‎
The Last Polymath: Muntadher Saleh‎‎‎‎‎‎‎‎‎‎‎‎
 
Caffeinated Pitch Bible- developed by Claire Wilson
Caffeinated Pitch Bible- developed by Claire WilsonCaffeinated Pitch Bible- developed by Claire Wilson
Caffeinated Pitch Bible- developed by Claire Wilson
 
Inter-Dimensional Girl Boards Segment (Act 3)
Inter-Dimensional Girl Boards Segment (Act 3)Inter-Dimensional Girl Boards Segment (Act 3)
Inter-Dimensional Girl Boards Segment (Act 3)
 
A Brief Introduction About Hadj Ounis
A Brief  Introduction  About  Hadj OunisA Brief  Introduction  About  Hadj Ounis
A Brief Introduction About Hadj Ounis
 
ART FORMS OF KERALA: TRADITIONAL AND OTHERS
ART FORMS OF KERALA: TRADITIONAL AND OTHERSART FORMS OF KERALA: TRADITIONAL AND OTHERS
ART FORMS OF KERALA: TRADITIONAL AND OTHERS
 
一比一原版(QUT毕业证)昆士兰科技大学毕业证成绩单如何办理
一比一原版(QUT毕业证)昆士兰科技大学毕业证成绩单如何办理一比一原版(QUT毕业证)昆士兰科技大学毕业证成绩单如何办理
一比一原版(QUT毕业证)昆士兰科技大学毕业证成绩单如何办理
 
acting board rough title here lolaaaaaaa
acting board rough title here lolaaaaaaaacting board rough title here lolaaaaaaa
acting board rough title here lolaaaaaaa
 
IrishWritersCtrsPersonalEssaysMay29.pptx
IrishWritersCtrsPersonalEssaysMay29.pptxIrishWritersCtrsPersonalEssaysMay29.pptx
IrishWritersCtrsPersonalEssaysMay29.pptx
 
2137ad Merindol Colony Interiors where refugee try to build a seemengly norm...
2137ad  Merindol Colony Interiors where refugee try to build a seemengly norm...2137ad  Merindol Colony Interiors where refugee try to build a seemengly norm...
2137ad Merindol Colony Interiors where refugee try to build a seemengly norm...
 
Fed by curiosity and beauty - Remembering Myrsine Zorba
Fed by curiosity and beauty - Remembering Myrsine ZorbaFed by curiosity and beauty - Remembering Myrsine Zorba
Fed by curiosity and beauty - Remembering Myrsine Zorba
 

Hennchthree

  • 1. Chapter3 Notes: Hennessy | Arithmetic for Computers 1 Chapter 4 (Hennessy 4th Ed): The Processor Supplement(s): Outline:  Introduction  Logic DesignConventions  Building a Datapath  A Simple Implementation Scheme  An Overview of Pipelining  Pipelined Datapath and Control  Data Hazards: Forwarding versus Stalling  Control Hazards  Exceptions  Parallelism and Advanced Instruction-Level Parallelism  Fallacies and Pitfalls  Concluding Remarks Content INTRODUCTION Chapter 1 explains that the performance of a computer is determinedbythree keyfactors:instructioncount, clock cycle time, and clockcycles per instruction (CPI). Chapter 2 explains that the compiler andthe instructionset architecture determine the instructioncount requiredfor a given program. However, the implementationof the processor determines boththe clockcycle time andthe number of clock cycles per instruction. Inthis chapter, we construct the datapathandcontrol unit for two different implementations of the MIPS instructionset. This chapter contains anexplanationof the principlesandtechniques usedinimplementing a processor, starting witha highlyabstract andsimplifiedoverview in this section. It is followedby a sectionthat buildsup a datapath and constructs a simple versionof a processor sufficient to implement aninstructionset like MIPS. The bulk ofthe chapter covers a more realistic pipelined MIPS implementation, followed bya sectionthat develops the concepts necessaryto implement more complex instructionsets, l ike the x86. A Basic MIPS Implementation – We will be examining an implementationthat includes a subset of the core MIPS instructionset:  The memory-reference instructions loadword(lw) and store word (sw)  The arithmetic-logical instructions add,sub,AND,OR, and slt  The instructions branchequal (beq)andjump(j), whichwe addlast This subset doesnot include all the integer instructions (for example, shift, multiply, anddivide are missing), nor does it include anyfloating-point instructions. However, the keyprinciplesusedincreating a datapathanddesigningthe control are illustrated. The implementationof the remaining instructions is similar. In examiningthe implementation, we willhave the opportunityto see how the instructionset architecture determines manyaspects ofthe implementation, and howthe choice ofvarious implementation strategies affects the clock rate and CPI for the computer. Manyof the keydesign principles introducedin Chapter 1 can be illustratedbylooking at the implementation, suchas the guidelines Make the common case fast and Simplicityfavors regularity. In addition, most concepts usedto implement the MIPS subset inthis chapter are the same basic ideas that are used to construct a broads pectrumof computers, from high-performance servers to general- purpose microprocessors to embeddedprocessors. An Overview of the Implementation – For everyinstruction, the first twosteps are identical:1) Sendthe program counter (PC) to the memorythat contains the code and fetch the instructionfrom that memory. 2) Readone or two registers, usingfields of the instructionto select the registers to read. For the load word instruction, we needto readonlyone register, but most other instructions require that we readtwo registers. After these two steps, the actions requiredto complete the instruction depend onthe instruction class. Fortunately, for eachof the three instructionclasses (memory-reference, arithmetic-logical, and branches), the actions are largelythe same, independent of the exact instruction. The simplicityand regularity of the MIPS instruction set simplifies the implementation bymakingthe executionof manyof the instructionclasses similar. For example, allinstruction classes, except jump, use the arithmetic-logical unit (ALU) after reading the registers. The memory-reference instructions use the ALU for anaddress calculation, the arithmetic-logical instructions for the operationexecution, and branches for comparison. After using the ALU, the actions required to complete various instruction classes differ. A memory-reference instructionwill needto accessthe memoryeither to readdata for a load or write data for a store. An arithmetic-logical or loadinstruction must write the data fromthe ALU or memorybackintoa register. Lastly, for a branchinstruction, we mayneed to change the next instructionaddress basedon the comparison;otherwise, the PCshouldbe incrementedby4 to get the address of the next instruction.
  • 2. Chapter3 Notes: Hennessy | Arithmetic for Computers 2 FIGURE4.1 An abstract view ofthe implementation ofthe MIPS subset showing the major functional units and the major connectionsbetween them. Allinstructions startby using theprogram counter to supply the instruction address to the instruction memory.After theinstructionis fetched,theregister operands used by an instruction are specified by fields ofthat instruction. Once the registeroperands have been fetched, they can be operated onto computea memory address (for a load or store), to computean arithmetic result (for an integer arithmetic-logicalinstruction),or a compare (for a branch). Iftheinstructionis an arithmetic-logical instruction, theresult fromtheALU mustbe written to a register. Ifthe operation is a load or store, the ALU result is used as an address to either store a valuefrom the registers or load a value from memory into the registers. The result fromtheALU or memory is writtenback intotheregister file. Branches requiretheuse of the ALU outputto determinethe nextinstruction address, which comes either from the ALU (where the PC and branch offset aresummed) or from an adder that increments thecurrent PC by 4. The thick lines interconnecting the funct ional units represent buses, which consist of multiplesignals. The arrows are used toguide the reader inknowing how information flows. Sincesignallines may cross, weexplicitly showwhen crossing lines areconnected by the presence of a dot where the lines cross. Figure 4.1 shows thehigh-levelview ofa MIPS implementation, focusing onthevarious functionalunits and their interconnection.Althoughthis figureshows most ofthe flow of data through theprocessor, itomits twoimportant aspects ofinstructionexecution. First, inseveral places, Figure4.1shows data going to a particular unit as coming from two different sources.For example, thevalue written into thePC can comefrom one oftwoadders, the data written intotheregister file can come from either the ALU or the data memory, and thesecond inputto theALU cancomefroma register ortheimmediate field oftheinstruction.In practice, these data lines cannot simply be wired together; we must add a logic elementthatchooses fromamong the multiplesources andsteers oneofthosesources to its destination. This selectionis commonly donewitha devicecalled a multiplexor, although this devicemight betterbe called a data selector. Appendix C describes themultiplexor,whichselects from among several inputs basedon thesetting ofits control lines. The control lines are set based primarily on information taken from the instruction being executed. The secondomissionin Figure4.1is that several oftheunits mustbe controlleddepending on the type ofinstruction. For example,the data memory must read on a load and write on a store. The registerfilemustbe written on a loadandanarithmetic-logicalinstruction.And, of course, the ALUmust perform oneofseveraloperations,as wesaw inChapter2. (AppendixC describes the detailed designof theALU.) Like the multiplexors, theseoperations aredirected by control lines that are set on the basis ofvarious fields in the instruction. FIGURE 4.2 The basic implementation of the MIPS subset, including the necessary multiplexorsand control lines. Thetop multiplexor (“Mux”) controls whatvaluereplaces the PC (PC +4 or the branch destinationaddress); themultiplexor is controlled by the gate that “ANDs” together the Zero output ofthe ALU and a control signal that indicates that the instruction is a branch. Themiddle multiplexor, whoseoutput returns to the register file, is used to steer the output of theALU (in thecase ofan arithmetic-logical instruction) or the output ofthe data memory (inthecase ofa load) for writing into theregister file. Finally, the bottom most multiplexor is used to determine whether the second ALU input is from the registers (for an arithmetic-logical instruction OR a branch) or from the offset field ofthe instruction (for a load or store). The added controllines arestraightforward and determine the operation performed at the ALU, whether the data memory should read or write, and whether the registers should perform a write operation. The control lines are shown in color to make them easier to see. Figure 4.2 shows thedatapathof Figure4.1 with thethreerequired multiplexors added, as well as control lines for the major functional units. A control unit, which has the instruction as an input, is used todeterminehow toset the controllines for thefunctional units and twoofthe multiplexors. Thethird multiplexor, which determines whether PC + 4 or the branchdestination address is written into the PC, is set based on the Zero output ofthe ALU, which is used to pe rform the comparison ofa beq instruction. The regularity and simplicity of the MIPS instruction set means that a simple decoding process can be used to determine how to set the c ontrol lines. In the remainder of thechapter, werefinethis view to fill inthedetails, which requires that weadd further functionalunits, increasethenumber ofconnections between units, and, ofcourse,enhance a control unitto control what actions aretaken for differentinstruction classes. Sections 4.3and 4.4 describea simpleimplementationthat uses a single long clock cyclefor every instruction and follows thegeneralform ofFigures 4.1and4.2. Inthis firstdesign, every instructionbegins execution on oneclock edge and completes execution onthenext clock edge.Whileeasier tounderstand,this approach is not practical,since the clock cyclemustbe stretchedto accommodatethelongestinstruction. After designing the control for this simple computer, we will look at pipelined implementation with all its complexities, including exceptions. LOGIC DESIGN CONVENTIONS This section reviews a few keyideas in digitallogic that wewill useextensively inthis chapter. The datapathelements in theMIPS implementationconsist oftwo differenttypes of logic elements: elements that operateon data values andelements thatcontainstate. The elements thatoperateon data values areallcombinational(An operational element, such as an AND gateor an ALU.), which means thattheiroutputs depend only on thecurrent inputs. Giventhesame input, a combinational element always produces the same output. The ALU shown inFigure 4.1 is an exampleofa combinational element. Givena setofinputs, it always produces the s ame output because it has no internal storage. Other elements in the designarenotcombinational,but instead contain state. An elementcontains state ifit has someinternal storage.We call theseelements state elements(A memory element, such as a register or a memory.) because, ifwepulled the power plug on the computer, wecould restartit by loading the stateelements wi th the values they containedbefore wepulledtheplug. Furthermore, ifwesaved andrestored thestateelements,it wouldbeas if thecomputer had never lostpower.Thus, thesestate elements completely characterize the computer. In Figure 4.1, the instruction and data memories, as well as the registers, are all exa mples ofstate elements. A stateelement has atleasttwo inputs and one output.The required inputs are the data valueto bewritteninto theelement and the clock, which determines when the da ta value is written.The output froma stateelement provides thevaluethatwas written inanearlier clock cycle. For example, one ofthe logically simplest stateelements is a D-type flip-flop, which has exactly thesetwo inputs (a value anda clock) andoneoutput. Inaddition to flip-flops, our MIPS implementation also uses two other types ofstate elements: memories andregisters, both of whichappear in Figure4.1. Theclock is used todeterminewhen the state elementshould bewritten; a state element can be read at any time. Logic components that contain stateare alsocalled sequential, becausetheir outputs depend onboththeirinputs and thecontents oftheinternalstate. For example, the output from the functional unit representing the registers depends both on the register numbers supplied and on what was written int o the registers previously.
  • 3. Chapter3 Notes: Hennessy | Arithmetic for Computers 3 We will use the word asserted (The signal is logically highor true) toindicatea signalthat is logically high and assertto specify that a signal should be driven logically high, and deassert or deasserted (The signal is logically low or false) to represent logically low. AssociatedContent  XXX To Be Cleared Further Reading  XXX More Research  XXX