CS 300 โ Lecture 1 Intro to Computer Architecture / Assembly Language Welcome Back!
(Assembly Language) Computer Architecture
Transcript of (Assembly Language) Computer Architecture
Computer System Architecture
2
Chapter 1: Digital Logic Circuits Chapter 2: Digital Components Chapter 3: Data Representation Chapter 4: Register Transfer and Microoperations
Chapter 5: Basic Computer Organization Chapter 6: Programming the Basic Computer Chapter 7: Microporgammed Control
Chapter 8: CPU
Chapter 11: I/O Organization
Chapter 12: Memory Organization
Basic Computer Organization and
Design - II 1. Memory-Reference Instructions 2. Register Reference Instructions 3. Input-Output and Interrupts 4. Design of Basic Computer 5. Design of Accumulator Logic
The three types of instructions, their register transfer statements, and their control functions. Connecting all into a basic computer.
4 11/7/2013
1. Memory-Reference Instructions
โข ๐ฐ๐น(12-14) to decoder outputs ๐ซ๐๐ซ๐โฆ. ๐ซ๐ which specifies one of 7 operations.
โข Effective address was stored in ๐จ๐น during ๐ป๐ (when ๐ฐ = ๐), or during ๐ป๐ (when ๐ฐ = ๐).
โข Execution starts with timing sequence ๐ป๐.
โข Actual execution requires a sequence of microoperations as data stored in memory cannot be processed directly.
5 11/7/2013
1. Memory-Reference Instructions โ (cont.)
6 11/7/2013
1. Memory-Reference Instructions โ (cont.)
And to ๐จ๐ช
โข Performs the AND logic operation on the pair of bits in ๐จ๐ช and the memory specified by the effective address.
7 11/7/2013
1. Memory-Reference Instructions โ (cont.)
BUN (Branch Unconditionally)
โข Transfers the program to the instruction specified by the effective address (jump).
8 11/7/2013
1. Memory-Reference Instructions โ (cont.)
BUN (Branch Unconditionally)
โข Transfers the program to the instruction specified by the effective address (jump).
9 11/7/2013
1. Memory-Reference Instructions โ (cont.)
BSA (Branch and Save Return Address)
โข Branches to a subroutine or procedure (call).
โ Stores the address of the next instruction of the main program, in a memory location specified by effective address (top of subroutine).
โBranches to address of first instruction of subroutine (the one right after the effective address).
10 11/7/2013
1. Memory-Reference Instructions โ (cont.)
BSA Example
11 11/7/2013
1. Memory-Reference Instructions โ (cont.)
12 11/7/2013
1. Memory-Reference Instructions โ (cont.)
โข Only seven timing sequences needed to execute the longest instruction.
โข Sequence Counter size?
13 11/7/2013
2. Register Reference Instructions
โข ๐ซ๐ = ๐ and ๐ฐ = ๐, with timing sequence ๐ป๐.
โข ๐ฐ๐น(0-11) specify one of 12 instructions.
โข Let the bits of ๐ฐ๐น be ๐ฉ๐๐๐ฉ๐๐โฆ. ๐ฉ๐.
โข Let the Boolean relation ๐ซ๐๐ฐโฒ๐ป๐ = ๐ซ.
โข Since the control function is distinguished by one of the bits in ๐ฐ๐น(0-11), then all control functions can be simply denoted by ๐๐ฉ๐.
14 11/7/2013
2. Register Reference Instructions โ (cont.)
โข Example: CLA
Hex. 7 8 0 0
Binary 0 111 1000 000 000
Control function that initiates the microoperations for this instruction is: ๐ซ๐๐ฐโฒ๐ป๐๐ฉ๐๐ = ๐๐ฉ๐๐
15 11/7/2013
๐ฐโ ๐ซ๐ ๐ฉ๐๐
2. Register Reference Instructions โ (cont.)
16 11/7/2013
2. Register Reference Instructions โ (cont.)
โข ๐บ๐ช is cleared after the execution of each instruction initiating ๐ป๐ (fetch) again that causes a new cycle.
โข After a HALT, the start flip-flip must be set manually.
17 11/7/2013
3. Input-Output Instructions
18 11/7/2013
Input-Output Configuration
3. Input-Output Instructions โ (cont.)
19 11/7/2013
โข ๐ซ๐ = ๐ and ๐ฐ = ๐, with timing sequence ๐ป๐.
โข ๐ฐ๐น(0-11) specify one of 12 instructions.
โข Let the bits of ๐ฐ๐น be ๐ฉ๐๐๐ฉ๐๐โฆ. ๐ฉ๐.
โข Let the Boolean relation ๐ซ๐๐ฐ๐ป๐ = ๐ฉ.
โข Since the control function is distinguished by one of the bits in ๐ฐ๐น(0-11), then all control functions can be simply denoted by ๐๐ฉ๐.
3. Input-Output Instructions โ (cont.)
20 11/7/2013
โข ๐บ๐ช is cleared after the execution of each instruction initiating ๐ป๐ (fetch) again that causes a new cycle.
Programmed control transfer
3. Input-Output Instructions
21 11/7/2013
Interrupts
โข Instead of wasting time by checking flags, let the external device inform the computer when it is ready for transfer.
โข Interrupt enable flip-flop ๐ฐ๐ฌ๐ต.
โข ๐ฐ๐ฌ๐ต = ๐ (with the ๐ฐ๐ถ๐ญ instruction) flags cannot interrupt computer.
โข ๐ฐ๐ฌ๐ต = ๐ (with the ๐ฐ๐ถ๐ต instruction) computer can be interrupted.
3. Input-Output Instructions
22 11/7/2013
Interrupt Cycle
โข Interrupt flag ๐น.
3. Input-Output Instructions
23 11/7/2013
Interrupt Cycle
โข Initiated after last execution phase if ๐น = ๐.
โข That is, if ๐ฐ๐ฌ๐ต = ๐, and either ๐ญ๐ฎ๐ฐ or ๐ญ๐ฎ๐ถ are 1. Happens with any clock transition except when timing signals ๐ป๐, ๐ป๐, ๐ป๐ are active.
3. Input-Output Instructions
24 11/7/2013
Interrupt Cycle Example
3. Input-Output Instructions
25 11/7/2013
Modified Fetch and Decode Phases
โข ??
4. Complete Computer Description
โข Flowchart of the basic computer operation Fig 5-15.
โข Control functions and microoperations of the basic computer Table 5-6.
26 11/7/2013
5. Design of Basic Computer
Components:
โMemory unit 4096ร16.
โNine registers: ๐จ๐น, ๐ท๐ช, ๐ซ๐น, ๐จ๐ช, ๐ฐ๐น, ๐ป๐น, ๐ถ๐ผ๐ป๐น, ๐ฐ๐ต๐ท๐น, ๐บ๐ช.
โ Seven flip-flops: ๐ฐ, ๐บ, ๐ฌ, ๐น, ๐ฐ๐ฌ๐ต, ๐ญ๐ฎ๐ฐ, ๐ญ๐ฎ๐ถ.
โTwo decoders: a 3ร8 operation decoder, and a 4ร16 timing decoder.
โA 16-bit common bus.
โControl logic gates.
โAdder and logic circuit connected to ๐จ๐ช. 27 11/7/2013
5. Design of Basic Computer โ (cont.)
Control Logic Gate
โข Input: decoders output, ๐ฐ๐น(0-11), ๐จ๐ช, ๐ซ๐น, the 7 flip-flops.
28 11/7/2013
5. Design of Basic Computer โ (cont.)
Control Logic Gate
โข Output: โ Signals to control the input of the nine registers.
โ Signals to control the read and write input of memory.
โ Signals to set, clear, or complement the flip-flips.
โ Signals for ๐บ๐, ๐บ๐, and ๐บ๐ to select a register for the bus.
โ Signals to control ๐จ๐ช adder and logic circuit.
โข The specs of various control signals comes directly from Table 5-6.
29 11/7/2013
5. Design of Basic Computer โ (cont.)
Control for Registers, Memory and Flip-Flops
โข Registers control inputs are LD, INR, and CLR.
โข Example: to find the gate structure associated with the control inputs of ๐จ๐น, scan Table 5-6 to find all statements that change content of AR.
30 11/7/2013
5. Design of Basic Computer โ (cont.)
Control for Registers, Memory and Flip-Flops
โข Example: control inputs of ๐จ๐น
31 11/7/2013
5. Design of Basic Computer โ (cont.)
Control for Common Bus
โข Each binary number is associated with a Boolean variable ๐.
32 11/7/2013
5. Design of Basic Computer โ (cont.)
Control for Common Bus
โข Each binary number is associated with a Boolean variable ๐.
33 11/7/2013
5. Design of Basic Computer โ (cont.)
34 11/7/2013
Control for Common Bus
โข Example: to find the logic that selects ๐จ๐น, scan Table 5-6 to find all statement that have ๐จ๐น as a source.
5. Design of Basic Computer โ (cont.)
35 11/7/2013
Control for Common Bus
โข Example: to find the logic that selects ๐จ๐น, scan Table 5-6 to find all statement that have AR as a source.
6. Design of Accumulator Logic
Control of ๐จ๐ช Register
โข From Table 5-6 extract all statement that changes the content of ๐จ๐ช.
36 11/7/2013
6. Design of Accumulator Logic โ (cont.)
Control of ๐จ๐ช Register
โข From Table 5-6 extract all statement that changes the content of ๐จ๐ช.
37 11/7/2013
6. Design of Accumulator Logic โ (cont.)
Control of ๐จ๐ช Register
38 11/7/2013
๐ซ๐๐ฐโฒ๐ป๐ = ๐ซ
6. Design of Accumulator Logic โ (cont.)
Control of Adder and Logic Circuit (one stage)
โข Can be divided into 16 stages, each stage corresponds to one it in ๐จ๐ช.
โข Each stage contains seven AND gates (one for each operation), one OR gate (combining all), and a full adder.
39 11/7/2013
6. Design of Accumulator Logic โ (cont.)
Control of Adder and Logic Circuit (one stage)
40 11/7/2013
Selected Problems
41 11/7/2013
REMARK: registers on the bus are numbered from 1 to 7, meaning that terminal 0 of MUX (selected by ๐๐๐๐๐๐=000) does not contribute to transfers through the bus.
111
001
010
011
100
101
110
Selected Problems โ (cont.)
42 11/7/2013
Selected Problems โ (cont.)
43 11/7/2013
Selected Problems โ (cont.)
44 11/7/2013
Selected Problems โ (cont.)
45 11/7/2013
Next Lecture
Revision + problem solving.
46 11/7/2013
Assignment
- Reading: Chapter 5: sections 6-10.
References
- Digital Design, 4th ed, M. Morris Mano, Prentice Hall, 2006.
-http://microcom.kut.ac.kr/ ch05
- God bless Google and Wiki!
47 11/7/2013