Week 3 - Information Processing in Humans and Machines (Part 3)
Week 3 - Information Processing in Humans and Machines (Part 3)
Security Fundamentals
Week 4: Information Processing in Humans and
Machines and Artificial Intelligence (Part 3)
Dr. Huseyin Hisil and Dr. Xueqiao Liu
1 0
0 1
1 1
Image Source: https://www.mheducation.com.au/ise-introduction-to-computing-systems-from-bits-gates-to-c-c-beyond-9781260565911-aus
Basic Storage Elements
● The R-S Latch
• The Quiescent State: We describe the quiescent (or quiet) state of a
latch as the state when the latch is storing a value, either 0 or 1.
1 1
out out
1 0
0 1
1 1 0
0 0
out 1
0 out
1 1
1 1 0
clear set
0 1
1 0
0 1
Image Source: https://www.mheducation.com.au/ise-introduction-to-computing-systems-from-bits-gates-to-c-c-beyond-9781260565911-aus
Basic Storage Elements
● The Gated D Latch
• To be useful, it is necessary to control when a latch is set and when it is
cleared. A simple way to accomplish this is with the gated latch. It
consists of the R-S latch.
• The latch will be set to value of D, but only when WE (write enable) is
asserted (i.e., WE == 1). When WE is not asserted (i.e., WE == 0), the
outputs S and R are both equal to 1, then the value stored in the latch
remains unchanged.
•In short, the next state is determined by the combination of the current
state and the current external input.
•In all the systems we will study, the output values will be specified solely by
the current state of the system.
Sequential Logic Circuits
● The Synchronous Finite State Machine
• Up to now, a transition from a current state to a next state in our finite
state machine happened when it happened. That is, there is no fixed
amount of time between successive inputs to the finite state machine.
This is the case we have discussed. These systems are asynchronous
because there is nothing synchronizing when each state transition must
occur.
• However, almost no computers work that way. On the contrary,
computers are synchronous because the state transitions take place,
one after the other, at identical fixed units of time. They are controlled
by a synchronous finite state machine.
Sequential Logic Circuits
The Clock
● A synchronous finite state machine transitions from its current state to its next
state after an identical fixed interval of time.
● Control of that synchronous behaviour is in part the responsibility of the clock
circuit.
● A clock circuit produces a signal (THE clock), whose value alternates between
0 volts and some specified fixed voltage.
● In digital logic terms, the clock is a signal whose value alternates between 0
and 1.
Sequential Logic Circuits
The Clock
● Below shows the value of the clock signal as a function of time
Watch: youtube.com/watch?v=cNN_tTXABUA
Instruction Processing
● Decode
○ Examines instruction in order to figure out what microarchitecture is being asked
to do.
○ First identify the opcode. Then depending on opcode, identify other operands
from the remaining bits.
● Evaluate Address
● Computes address of memory location that is needed to process the
instruction.
● Not all instructions access memory to load or store data.
Instruction Processing
● Fetch Operands
• This phase obtains the source operands needed to process the instruction.
● Execute
• This phase carries out the execution of the instruction.
•E.g., for the ADD instruction, this phase consists of the step of performing the
addition in the ALU.
● Store Result
• The result is written to its designated destination.
•Write address to MAR, and data to MDR + assert WRITE signal to memory.
•E.g., for the ADD instruction, in many computers this action is performed during
the EXECUTE phase. That is, an ADD instruction can fetch its source operands,
perform the ADD in the ALU, and store the result in the destination register all in a
single clock cycle. In other words, in this case a separate STORE RESULT phase is
not needed.
Instruction Processing
● Changing the Sequence of Execution
○ A computer program is usually executed in sequence, i.e., first instruction is executed, then
second instruction is executed, followed by third instruction, and so on.
○ Sometimes we want to change the sequence of instruction execution, and control instruction
can do it. E.g., loop, if-then, and function call
○ Each instruction cycle starts with loading the MAR with the PC. Thus, if we wish to change the
sequence of instructions executed, we must change the contents of the PC between the time it
is incremented (during the FETCH phase of one instruction) and the start of the FETCH phase of
the next instruction.
○ Control instructions perform that function by loading the PC during the EXECUTE phase, which
wipes out the incremented PC that was loaded during the FETCH phase. The result is that, at
the start of the next instruction cycle, when the computer accesses the PC to obtain the
address of an instruction to fetch, it will get the address loaded during the previous instruction’s
EXECUTE phase, rather than the next sequential instruction in the computer’s program.
○ The most common control instruction is the conditional branch (BR), which either changes the
contents of the PC or does not change the contents of the PC, depending on the result of a
previous instruction (usually the instruction that is executed immediately before the conditional
branch instruction).
Instruction Processing
● Control of the Instruction Cycle
○ The instruction cycle is controlled by a synchronous
finite state machine.
■ Each state corresponds to one machine cycle of activity
that takes one clock cycle to perform
■ The processing controlled by each state is described
within the node representing that state
■ The arcs show the next state transitions