Chapter 7 - CPU Structure and Function Ver 1
Chapter 7 - CPU Structure and Function Ver 1
Logic gates
Sum of products
Simplification/minimization
Flip flops
Logic Gates
Let recall: Sum of product &
4
Simplification
A B C D F
a. Write the Boolean function for the given truth
0 0 0 0 1
table and draw the circuit diagram
0 0 0 1 0
0 0 1 0 0 b. Using Boolean identities table, simplify the
0 0 1 1 1 Boolean function obtain in (a) and draw the
0 1 0 0 1 circuit diagram
0 1 0 1 0
0 1 1 0 1 c. Using Karnaugh Map, simplify the Boolean
0 1 1 1 1 function obtain in (a) and draw the circuit
1 0 0 0 1 diagram
1 0 0 1 0
d. Draw the circuit diagram using NAND gate
1 0 1 0 0
based on your answer in (c)
1 0 1 1 0
1 1 0 0 1
1 1 0 1 0
1 1 1 0 0
1 1 1 1 0
Let recall: HA/FA
5
Determine the value (FF1, FF2, FF3, w, x, y and z) of the following circuit by completing
the given truth table. Input A changes value as shown in the truth table. FF1, FF2 and
FF3 is the D Flip Flop while w, x, y and z is the output
0 0 0 0 1 0 0 0
FF1
1 1 0 0 1 1 0 0
0 1 0 0 1 1 0 0
1 1 1 0 0 1 1 0
FF2
0 1 1 0 0 1 1 0
1 0 1 1 1 0 1 1
0 0 1 1 1 0 1 1
FF3
1 1 0 1 1 1 0 1
0 1 0 1 1 1 0 1
1 1 1 0 0 1 1 0
7
I. Processor organization
II. Register organization
III. Instruction cycle & Data Flow
IV. Instruction pipelining
Let watch video
9
Scott CPU:
https://www.youtube.com/watch?v=cNN_tTXABUA
ALU:
https://www.youtube.com/watch?v=UhxNciYUenA
https://www.youtube.com/watch?v=WvDogBOFYKA
CPU: SYSTEM BLOCK DIAGRAM
Processor organization: 3 components
11
The four registers are used for the movement of data between the CPU and
memory. Within the CPU, data must be presented to the ALU for processing.
The ALU may have direct access to the MBR and user-visible registers.
Alternatively, there may be additional buffering registers at the boundary to
the ALU: these registers serve as input and output registers for the ALL and
exchange data with the MBR and user-visible registers.
Register organizations
19
8086 CPU Registers
20
Control and status register: instruction pointer (IP) and the status word, or
flags register.
The CPU checks the program counter to ascertain which instruction to carry out
next. It then updates the program counter to point to the next instruction. Thus the
program counter will always point to the next instruction to be executed.
8086 CPU Registers (cont…)
22
Example - http://www.eastaughs.fsnet.co.uk/cpu/execution-fetch.htm
Data Flow (Indirect cycle)
26
Example - http://www.eastaughs.fsnet.co.uk/cpu/execution-indirect.htm
Data Flow (Decode/Execute cycle)
27
The execute cycle depends on the various machine instructions is in the IR.
This cycle may involve transferring data among registers, read or write
from memory or I/O, and/or the invocation of the ALU.
Data Flow (Interrupt cycle)
28
“It is a technique used in the design of computers to increase their instruction throughput (the
number of instructions that can be executed in a unit of time). Pipelining does not reduce the
time to complete an instruction, but increases instruction throughput by performing multiple
operations in parallel”
- Wikipedia -
3. Factory - https://www.youtube.com/watch?v=ovMz2gTjvFA
Pipeline theory:
1. https://www.youtube.com/watch?v=doJpguZFTe0
2. https://www.youtube.com/watch?v=l3Rvf7tv2dY
3. https://www.youtube.com/watch?v=r_LEyI5UTww
Pipelining strategy
32
During the execution of an instruction, there a times when main memory is not being
accessed. This time could be used to fetch the next instruction in parallel with the
execution of the current one.
The first stage fetches an instruction and buffers it. When the second stage is free,
the first stage passes the buffered instruction (to be executed).
While the second stage is executing the instruction, the first stage takes advantage
of any unused memory cycles to fetch and buffer the next instruction. This is called
instruction prefetch or fetch overlap.
Pipelining strategy (cont…)
33
Example - http://www.eastaughs.fsnet.co.uk/cpu/further-pipelining.htm
Pipeline - decomposition
34
Pipelining can severely cut the time taken but the instruction execution
process do not necessarily take an equal amount of time.
E.g. Time taken to 'execute' generally longer than 'fetch‘ and this makes it
much harder to synchronise the various stages of the different instructions.
Also, some instructions may be dependent on the results of other earlier
instructions. This can arise when data produced earlier needs to be used,
when a conditional branch based on a previous outcome is used.
Solution: breaking the instruction execution cycle into stages that are
more likely to be of an equal duration. For example, the diagram below
shows how the cycle can be broken down into six stages rather than
three:
Pipelining – decomposition (cont…)
35
Figure 12.10 shows that a six-stage pipeline can reduce the execution time
for 9 instructions from 54 time units to 14 time units.
Pipelining – decomposition (cont…)
37
*http://www.teach-ict.com/as_as_computing/ocr/H447/F453/3_3_8/lowlevel/miniweb/pg4.htm
Pipelining: Disadvantages
43