CSEN402: Computer OrganizationLecture 1: Register Transfer Level I
Nada Sharaf
Spring Semester 2020
Nada Sharaf Lecture 1: Introduction Spring Semester 2020 1 / 37
General Information
Lecturer: Nada Sharaf, office: C7.211, [email protected].
TAs:Omnia Ayman, Sama El Baroudy, Fatma El Azab and NadaNasser
Textbook: Computer System Architecture, Third Edition, M. Morris,Mano
Share your questions through piazza:https://piazza.com/#spring2020/csen402csis402
Nada Sharaf Lecture 1: Introduction Spring Semester 2020 2 / 37
Credits and a Huge Thank You to Dr. MohammedEl-Mahdy
Nada Sharaf Lecture 1: Introduction Spring Semester 2020 3 / 37
Tentative Grading
Assignments (project) (15%)
Quizzes (15%)
Midterm (25%)
Final (45%)
Nada Sharaf Lecture 1: Introduction Spring Semester 2020 4 / 37
What
You can write algorithms
You can write programs
How do they work
How is the machine code acutally used
Nada Sharaf Lecture 1: Introduction Spring Semester 2020 5 / 37
Why
Computing is everywhereI Embedded systemsI Internet of Things
Optimizations could b achievedusing:
I ArchitectureI Better programsI Enhanced hardware
Nada Sharaf Lecture 1: Introduction Spring Semester 2020 6 / 37
How
Study of the Basic Computer and how it works
Nada Sharaf Lecture 1: Introduction Spring Semester 2020 7 / 37
Let us Start :)
Nada Sharaf Lecture 1: Introduction Spring Semester 2020 8 / 37
Register Transfer Level
Digital systems are designed using a modular approach
Modules are connected with data and control paths
A module is best describes using:I The registers it containsI Operations done on data stored in them Microoperations
Nada Sharaf Lecture 1: Introduction Spring Semester 2020 9 / 37
Microoperations
Basic operation performed onthe data in one or more registers
Result could clear contents of aregister or transfer data toanother register
ExampleI ShiftI ClearI LoadI Count
Nada Sharaf Lecture 1: Introduction Spring Semester 2020 10 / 37
Microoperations
Done in one clock cycle
R ← f (R,R)
Nada Sharaf Lecture 1: Introduction Spring Semester 2020 11 / 37
Digita Computer Description
The internal hardware of a digital computer is specified by:
1 The registers and their functions2 Sequence of microoperations on registers
I What are the allowed and available operations
3 Control of microopertionsI Signals to control and initiate the operations
Nada Sharaf Lecture 1: Introduction Spring Semester 2020 12 / 37
Register Transfer Language
Instead of using words to describe what the operations do in terms ofthe sequence of transfers between regsiters
Special syntax and symbols
Register Transfer Language
Symbolically describes the microoperations sequence of betweenregisters
Any functionality of the system could be describes using thisdescription level
Nada Sharaf Lecture 1: Introduction Spring Semester 2020 13 / 37
Registers
A register is described by anupper case letter
The letter could be followed bya numeral e.g. R3, R5, ... etc
There are some special registernames that indicate thefunctionality
I MAR: Memory AddressRegister
I PC: Program CounterI IR: Instruction Register
To save the bits of a register,flip flops are used
Nada Sharaf Lecture 1: Introduction Spring Semester 2020 14 / 37
Register Representation in Block Diagram
Rectangular box with name inside it
Show the individual bits
Show the numbering of bitsIndividual bits could be distinguished
Show the partitionsPC(L) or PC(0-7) or PC(H) or PC(8-15)
Nada Sharaf Lecture 1: Introduction Spring Semester 2020 15 / 37
Register Transfer
R2← R1
Used to copy contents from one register to the other
In this example contents of R1 are copied to R2
Which bits? All bits are being transferred
What happens to R1? It is unchanged i.e. non-destructive operation
Nada Sharaf Lecture 1: Introduction Spring Semester 2020 16 / 37
Register Transfer: How does it Happen
R2← R1
Contents of R2 are replaced by the current content of R1
R1 is unchanged
Circuits are available from output of source to input of destination
Transfer could also be controlled
Nada Sharaf Lecture 1: Introduction Spring Semester 2020 17 / 37
Control Signals
Control structures are crucial in all types of programming
We usually want actions (register transfer in our case) to happenunder certain conditions
We introduce if-then-else statements
if (P = 1) then (R2← R1)I P is our control signalI In case the control signal P holds the value 1I then load the contents of R1 into R2
Nada Sharaf Lecture 1: Introduction Spring Semester 2020 18 / 37
Control Functions
A control function can be used
A control function is a Boolean variable
This variable is equal to 1 or 0.
terminated with a colon
P : R2← R1
Equivalent to if (P = 1) then (R2← R1)
Nada Sharaf Lecture 1: Introduction Spring Semester 2020 19 / 37
Block Diagram
P : R2← R1
Nada Sharaf Lecture 1: Introduction Spring Semester 2020 20 / 37
Timing Diagram
P : R2← R1
Control variable is synchronized using the same clock
P is activated by the rising edge of the clock pulse at time t.
On the next positive edge of the clock. the load input is active andthe data is loaded
Nada Sharaf Lecture 1: Introduction Spring Semester 2020 21 / 37
Simultaneous Operations
P : R2← R1,R1← R2
What does this do? Sli.do J762
It swaps the contents
Block Diagram:
Assume registers have edge triggered flip flops
Nada Sharaf Lecture 1: Introduction Spring Semester 2020 22 / 37
Other Examples: Draw Block Diagrams
A + B : R2← R1,R1← R2
AB : R2← R1,R1← R2
P : R2← R1 + R3
Nada Sharaf Lecture 1: Introduction Spring Semester 2020 23 / 37
Register Transfer Symbols
Nada Sharaf Lecture 1: Introduction Spring Semester 2020 24 / 37
Bus and Memory Transfers
A digital system has many registers that have to be connected
If separate lines are used to connected individual registers, A Lot ofwires will be used
A common bus system is usually used
Common lines
One for every every bit of a register
Binary information is transferred one at a time
How to choose which register is selected by the bus? Control Signals
Nada Sharaf Lecture 1: Introduction Spring Semester 2020 25 / 37
Bus System
Multiple sources and destinations
Bus ← R
Nada Sharaf Lecture 1: Introduction Spring Semester 2020 26 / 37
Multiplexer
f depends on the value of the selection lines
Nada Sharaf Lecture 1: Introduction Spring Semester 2020 27 / 37
Multiplexers and Bus System
Multiplexer selects the source register
Binary information is then placed on the bus
Nada Sharaf Lecture 1: Introduction Spring Semester 2020 28 / 37
Bus System with Multiplexers
Nada Sharaf Lecture 1: Introduction Spring Semester 2020 29 / 37
Bus System with Multiplexers
MUX0 has the 0-bits of all 4 registers
MUX1 has the 1-bits of all 4 registers
MUX2 has the 2-bits of all 4 registers
MUX3 has the 3-bits of all 4 registers
Nada Sharaf Lecture 1: Introduction Spring Semester 2020 30 / 37
Bus System with Multiplexers
Same selection lines are used
Output is formed from the four output bits of the four multiplexers
Nada Sharaf Lecture 1: Introduction Spring Semester 2020 31 / 37
Bus System with Multiplexers
S1 S0 Register0 0 A0 1 B1 0 C1 1 D
Nada Sharaf Lecture 1: Introduction Spring Semester 2020 32 / 37
Multiplexers Numbers
How many multiplexers are required for a bus system with eightregisters each having 16 bits
How many data input lines
How many selection lines: Sli.do J762
16, 8 and 3
Nada Sharaf Lecture 1: Introduction Spring Semester 2020 33 / 37
Bus System
At any time, one register can place its content
Bus could be mentioned or notI
R2← R1
I
Bus ← R1,R2← Bus
Nada Sharaf Lecture 1: Introduction Spring Semester 2020 34 / 37
LogiSim
You can download it throughhttps://sourceforge.net/projects/circuit/
Online with limited capablities throughhttps://www.rollapp.com/launch/logisim
Nada Sharaf Lecture 1: Introduction Spring Semester 2020 35 / 37
References
Chapter 4
Nada Sharaf Lecture 1: Introduction Spring Semester 2020 36 / 37
Thank you :)
Nada Sharaf Lecture 1: Introduction Spring Semester 2020 37 / 37