Escolar Documentos
Profissional Documentos
Cultura Documentos
(Assembly Language)
Computer Architecture
Dr. Salma Hamdy
10/7/2013
s.hamdy@cis.asu.edu.eg
Chapter 8: CPU
1. Register Transfer
Registers are designated by Capital Letters (sometimes followed by numerals):
MAR (Memory Address Register). PC (Program Counter). IR (Instruction Register). R1 (Processor Register).
10/7/2013
10/7/2013
10/7/2013
10/7/2013
3. Bus Transfer
Common Bus is a more efficient scheme for transferring information between registers in a multiple-register configuration. A bus structure = a set of common lines one for each bit of a register. Control signals determine which register is selected.
10/7/2013
10
10/7/2013
12
Register
13
10/7/2013
14
10/7/2013
16
10/7/2013
18
4. Memory Transfer
Memory Unit is a collection of storage cells together with associated circuits needed to transfer information in and out of storage. Memory read : transfer information into from the memory word selected by the address in . : [] Memory Write : transfer information from into the memory word selected by the address in .
10/7/2013 19
10/7/2013
20
21
22
5. Microoperations
Register transfer do not change binary info. All other microoperations change content during transfer. The basic set of microoperations:
Arithmetic Logic Shift
notation
and
23
6. Arithmetic Microoperations
Basic arithmetic microoperation:
Add Subtract Complement Shift
All other arithmetic microoperations can be obtained from a variation or a sequence of them.
10/7/2013 24
10/7/2013
25
10/7/2013
26
Remember that = + = + + Hence combine addition and subtraction in one circuit with a control input .
= (add)
= (subtract)
10/7/2013
27
10/7/2013
28
10/7/2013
29
10/7/2013
30
10/7/2013
31
A+1111=A-1
10/7/2013
A-1+1=A
32
7. Logic Microoperations
Logic microoperations consider each bit of the register separately and treat them as binary variables. Seldom used in scientific computations but very useful for bit manipulation and logical decisions. e.g. :
1010 Content of 1100 Content of 0110 Content of after =
10/7/2013 33
e.g. + : +, Means: if( OR ) then (add to and put the result in , and perform OR and put the results in ).
10/7/2013 34
10/7/2013
35
10/7/2013
36
10/7/2013
37
10/7/2013
38
Selective-complement
A A B
Complements bits in A where there are corresponding 1s in B. It does not effect bit A before positions that have 0s in B. 1010 1100 B (Logic Operand)
10/7/2013
0110 A After
39
Selective-mask
A A B
Similar to the selective-clear operation except that the bits of A are cleared only where there are corresponding 0s in B. 1010 A before
10/7/2013
2) OR 0000 1010 A before 1001 0000 B insert 1001 1010 A after insert
41
8. Shift Microoperations
Used for serial transfer of data. with conjunction with arithmetic, logic and data-processing operations. Three types:
Logical Circular Arithmetic
10/7/2013
42
8. Shift Microoperations
Logical Shift Transfers 0 through the serial input. Shift-left or shift-right. The bit transferred to the end position through the serial input is assumed to be 0 during a logical shift (zero inserted).
0 0
10/7/2013
43
8. Shift Microoperations
Circular Shift Shift-left or shift-right. The circular shift circulates the bits of the register around the two ends without loss of information.
10/7/2013
44
8. Shift Microoperations
Arithmetic Shift Shifts a signed binary number to left or right Shift-left == multiplication by 2. Shift-right == division by 2. Must leave the sign bit unchanged because the sign of the number remains the same.
10/7/2013
45
8. Shift Microoperations
Arithmetic Shift Shift-left
Carry out Sign bit
Rn-1 Rn-2
MSB
R2 ashl R2
0 insert
....
. R1
LSB
R0
Shift-right
MSB
R2 ashr R2
LSB lost
LSB
8. Shift Microoperations
Hardware Implementation Bidirectional shift register with parallel load (previous lectures). Combinational circuit
More efficient. Register on common bus, to shifter, back to register. Only one clock pulse to load and shift. MUX to decided shift type. n-bit shifter == n multiplexers.
10/7/2013 47
8. Shift Microoperations
Hardware Implementation A 4-bit Combinational shifter
10/7/2013
48
10/7/2013
49
10/7/2013
50
Selected Problems
To be selected!
10/7/2013
51
Next Lecture
Basic Computer Organization and Design.
Assignment
- Reading: Chapter 4.
10/7/2013
52
References
- Digital Design, 4th ed, M. Morris Mano, Prentice Hall, 2006. -http://microcom.kut.ac.kr/ ch04 - God bless Google and Wiki!
10/7/2013
53