Sie sind auf Seite 1von 8

11/4/2011

Structure - The Control Unit

Control Unit

CPU
Sequencing
By ALU Logic
Control
Dr. L. Ranathunga Internal
Bus
Unit
Control Unit
Registers Registers and
Decoders

Control
Memory

Sequential Logic Flip-Flop


 Combinational circuits have only inputs and
outputs. The output is a function of the input only.
 Sequential circuits have a notion of state. The  The basic circuit for storing information in a
output is a function of the input and the previous digital machine is called a flip-flop. There are
state. several fundamental types of Flip-Flops and many
 Commonly referred to as Finite state machine circuit designs.
(FSM)
 Two common characteristics
 An FSM distinguished from a combinational logic
in that the past history inputs to the FSM  Bistable device
influences its state and output.  Has two signals, one of which is the complement of
 This is important for implementing memory other.
circuits as well as control units in a computer.

Ex: RSFF Registers


 A single bit of information is
stored in a flip-flop
 A group of N bits, making up
an N-bit word
 Registers are formed from a
D0 D1 D2 D3
group of flip-flops arranged
to hold and manipulate a
data word using some Abstract view of
CLK
common circuitry. 4 bit register

Q0 Q1 Q2 Q3

1
11/4/2011

Von Neumann/Turing
Computer word structure  Stored Program concept
 The data and instruction words in computers tend to  Main memory storing programs and data
be organized systematically.  ALU operating on binary data
 Instruction word = data word = memory word (in  Control unit interpreting instructions from memory
most early cases) and executing
 A special term used for an 8-bit word is called Byte.  Input and output equipment operated by control unit
 210 Bytes = 1 Kb, 210 Kb = 1 Mb, 210 Mb = 1Gb..
 A number that identifies the location of a word in a  Princeton Institute for Advanced Studies (IAS)
memory is called address  Completed 1952
 Always used binary number, although hexadecimal used
 Refers to a word location in memory

The Stored Program Concept The Stored Program Concept and its
Implications
 Von Neumann’s proposal was to store the program
instructions right along with the data  The Stored Program concept had several
 This may sound trivial, but it represented a technical formations:
profound paradigm shift  Four key sub-components operate together to
make the stored program concept work
 The stored program concept was proposed about
 The process that moves information through the
fifty years ago; to this day, it is the fundamental
sub-components is called the “fetch execute”
architecture that fuels computers. cycle
 Think about how amazing that is, given the short  Unless otherwise indicated, program
shelf life of computer products and technologies… instructions are executed in sequential order
 Easy to access and modify data and programs

Four Sub-Components Structure of Von Nuemann


 There are four sub-components in von Neumann machine
architecture:
 Memory
Arithmetic and Logic Unit
 Input/Output (called “IO”)
 Arithmetic-Logic Unit
Input
 Control Unit Output Main
Equipment Memory
 While only 4 sub-components are called out, there
is a 5th, key player in this operation: a bus, or wire,
that connects the components together and over
Program Control Unit
which data flows from one sub-component to
another

2
11/4/2011

Von Nuemann bottleneck Harvard Architecture


 Shared bus between the program memory and data  The name Harvard Architecture comes from the
memory leads to the Von Neumann bottleneck Harvard Mark I relay-based computer
 Limited throughput (data transfer rate) between the  Harvard Architecture has physically separated signals
CPU and memory compared to the amount of and storage for program and data memory
memory  Possible to access program memory and data memory
 Limits the effective processing speed when the CPU simultaneously
is required to perform minimal processing on large  Program memory is read-only and data memory is read-
amounts of data write
 Impossible for program contents to be modified by the
program itself

ALU Functional Parts of ALU


 Perform arithmetic and logic operations on input ALU
data.
Accumulator
 Set of registers with accumulator register
 Registers store the results of all the arithmetic and
logic operations. Memory Logic Circuits Control
Unit Unit

B Register

ALU Operation Fetch/Execute cycle


 All computers can be summarized with just two basic
 The control unit receive an instruction (from memory components:
unit) specifying that a number stored in a particular  (a) primary storage or memory
memory location (address) is to be added to the  (b) central processing unit or CPU
number presently stored in the accumulator register
 CPU is the "brains" of the computer.
 The number to be added is transferred from memory to
the B Register  Its function is to execute programs which are stored in
memory
 The number in the B register and the number in the
accumulator register are added together in the logic  This procedure is accomplished by the CPU fetching an
circuits (upon command from the control unit) instruction stored in memory, then executing the
retrieved (fetched) instruction within the CPU before
 The result sum is then send to the accumulator to be proceeding to fetch the next instruction from memory
stored
 This process continues until they are told to stop

3
11/4/2011

Fetch/Execute cycle IAS - details


 The following illustration summarizes this continuous process of  1000 x 40 bit words
fetching and execution of instructions.  Binary number
 2 x 20 bit instructions
 Set of registers (storage in CPU)
 Memory Buffer Register (MBR)
 Memory Address Register (MAR)
 Instruction Register (IR)
 Instruction Buffer Register (IBR)
 Program Counter (PC)
 Accumulator (ACC)
 Multiplier Quotient (MQ)

Computer Organization –
Structure of IAS - detail Motherboard/Chipset/Buses
Central Processing Unit
Arithmetic and Logic Unit
 The motherboard is the main circuit board
inside a computer, containing the central
Accumulator MQ processing unit (CPU), the bus, memory
Arithmetic & Logic Circuits
sockets, expansion slots, and more.
 The associated chips which help in overall
Input MBR system integration
Output Instructions
& Data Main  And which are fabricated onto the motherboard
Equipment
Memory are collectively called the Chipset.
IBR PC  Buses are the medium through which all the
MAR devices communicate.
IR Control  E.g. PCI, Microchannel, ISA, EISA etc.
Circuits
Address
Program Control Unit

Computer Organization – CPU CPU (Contd..)


 Control Unit (CU)
 The part of a computer which controls all the other
 The control unit fetches instructions from memory
parts.
and decodes them to produce signals which control
 Generally called the “processor”. the other parts of the computer.
 Composed of –  This may cause it to transfer data between memory
 Control Unit (CU) and ALU or to activate peripherals to perform input
 Arithmetic and Logic Unit (ALU) or output.
 Registers and associated memory.

4
11/4/2011

CPU (Contd..) CPU (contd..)


 Arithmetic and Logic Unit (ALU)  Registers and Associated Memory
 The combinatorial part of the central processing
 Registers are like internal buffers for the CPU. The
unit which performs operations such as addition,
subtraction and multiplication of integers and bit- CPU uses the registers to decode instructions and
wise AND, OR, NOT and other Boolean operations. for using them for computing the final output
 The width in bits of the data which the ALU handles
(ALU).
is usually the same as that quoted for the processor  Additionally the CPU may make use of internal
as a whole whereas its external buses may be memory (mostly SRAM as they are the fastest) for
narrower. caching code and data for frequently accessed
operations.

CPU - Instructions CPU – Machine Programs


 These are basically control commands for the
control unit of the CPU which dictate the task to be  These are full length programs
performed (E.g. add, subtract, move, shift, interrupt composed of several instructions
etc.). which perform the real world task at
 The instructions can be considered as an interface hand.
to the features offered by the CPU.
 Every CPU has a Program Counter
 Instructions are composed primarily of “opcode”
which specifies what the instruction is and the (PC) register which is used to keep
“operands” which specify the data on which that track of the current instruction being
instruction needs to operate on. executed.

CPU (Contd..) CPU (Contd..)


 CISC (Complex Instruction Set Computers)
 Computers are classified into two broad categories
depending upon the complexity of the instructions  They have a huge set of instructions at offer.
supported by the CPUs.  The format of their instructions are not uniform.
 RISC (Reduced Instruction Set Computer)  The control unit design of CISC CPUs are overly
 They have a very small subset of instructions to offer. complex.
 The format of their instructions are uniform.  Since they can support any arbitrary instruction,
 Control Unit design is very simple. they are very flexible.
 They do not have flexibility.

5
11/4/2011

CPU – Control Unit Control Unit - Designs


 Control Unit (CU) is the heart of the CPU.  Hardwired (Conventional)
 Every instruction that the CPU supports has to be  used in high-performance and RISC computers
decoded by the CU and executed appropriately.  as the name implies, the microinstructions are hard-
 Every instruction has a sequence of wired into the computer.
microinstructions behind it that carries out the  This is much faster but much less flexible.
operation of that instruction.  Typically a grid/array is used to establish a sequence
of connections to construct the appropriate
circuitry.

Control Unit – Designs (Contd..) Control Unit – Hardwired vs


 Microprogrammed Microprogrammed
 The instructions are programmable.  Hardwired
 i.e. the computer architect is able to program a  Composed of combinatorial and sequential circuits
particular instruction using micro-instructions and that generates complete timing that corresponds
download the entire sequence of micro-instructions with execution of each instruction.
into the CU.  Time consuming and expensive to design.
 Slow, Additional time is spent decoding and executing  Difficult to modify.
microinstructions.
 but fast !
 Very flexible.

CPU – Instruction Cycle


Control Unit – Hardwired Vs  Operation of a computer consists of a sequence
Microprogrammed of instruction cycles.
 Microprogrammed  An instruction cycle is the time needed to
 Design is simpler. execute one complete machine instruction.
 Problem of timing each microinstruction is broken  Instruction cycle can be subdivided into -
down. Microinstruction cycle handles timing in a  Fetch
simple and systematic way  retrieving the instruction

 Easier to modify, meaning really flexible.  Indirect


 retrieving indirect operands (if any)
 Slower than hardwired control since you have
additional time spent in decoding microinstructions  Execute
and searching them.  executing the instruction.

 Interrupt
 Handle any exceptions (if any)

6
11/4/2011

Instruction Cycle (contd..) Control Unit - Microprogramming


 Most important is the Fetch-Execute Cycle.  Each step of an instruction can be further broken
 It consists of down into micro operations as discussed.
 Extract the instruction from memory  These micro operations are accomplished using what
 Calculate the address of the next instruction by
are called micro instructions.
advancing the PC (Program Counter)  Therefore, every instruction can be said to have a
 Decode the opcode corresponding micro program which accomplishes
 Calculate the address of the operands (if any) the task of that instruction.
 Extract the operand from memory
 Execute
 Calculate address of the result
 Store result in memory

Microprogramming (contd..) Microprogramming


 Basic components of Microprogramming are  Instruction Register stores current machine
language instruction from program in main
 Instruction Register (IR) memory.
 Stores the current instruction.  Each machine instruction is represented as a
 Control Store series of microinstructions, in the Control Store.
 Repository for microprograms. A form of memory.  Micro Program Counter points to the appropriate
 Sequencer location of the current microinstruction in the
 A microprogram control unit. A control unit within
Control Store.
another.  Executing a machine instruction requires finding
the microinstructions and executing them until
 Microprogram Program Counter the microinstruction has completed.
 Similar to a Program Counter

Microprogramming – (Ordinary Operation) Microprogramming – (Organization of


 Sequencer causes address of current machine Microprograms)
instruction to be placed in micro Program Counter
 Each Machine Language operation is actually a
 It may also clear the microinstruction buffer.
sequence of microinstructions
 Sequencer initiates control-store read and transfers
microinstruction to microinstruction buffer  Each of these microprograms is placed in the
control store.
 Microinstruction decoder decodes
microinstruction into microorders and issues  Included are the microprograms for instruction
those orders over control lines fetch, interrupt initiation and other routines
 If a non-branching microinstruction, then micro separate from machine language instructions.
Program Counter is incremented, otherwise new
address in control store is calculated and placed in
micro Program Counter

7
11/4/2011

Microprogramming – (Branching /Non- Microprogramming – (Microinstruction


Branching) Formats)
 Microinstructions are simply a list of control
 Branching microinstructions hold the branch orders for the various buses and gates in the
address inside of the microinstruction itself. computer
 Branching occurs only within the Control Store  Horizontal Control
(as opposed to a machine language branch to  each microinstruction is a series of bits, each of which
another location in main memory) represents a single control line
 Special bit designates whether a  Vertical Control
microinstruction is a branch or nonbranch.  groups of bits in the microinstruction represent
 Internal Address Bus is used to transfer new commands. This requires decoding or demultiplexing
control store location before the control commands can be issued
 Nonbranching instructions require that the  Horizontal is faster but requires greater lengthed
micro Program Counter be incremented microinstructions.

Computer Organization - Memory Computer Organization –


(Input/Output System (I/O))
 memory are internal storage areas in a system.
 There is a need to communicate with components and
 Memory operations rely on these – with the external world. Each of the communication
 MAR (Memory Address Register) – Stores the endpoints is called a “port”.
address of the memory location that is to be  I/O System comprises of the set of all I/O devices in
accessed the computer system including physical devices and
 MDR (Memory Data Register) – Stores the data that I/O interface devices
is either written to or read from memory.  In the early days of computers, I/O devices were
limited to line printer, punch card reader.
 MBR (Memory Buffer Register) – Buffer register for
temporary storage  Today there are numerous types of I/O devices
(terminal, mouse, scanner, etc…)
 MCRs (Memory Control Registers) – To setup access  CPU-controlled I/O
to the memory.  the CPU would interrupt its current process to directly handle
all I/O.

 Questions?

Das könnte Ihnen auch gefallen