csen402: computer organization lecture 1:...
TRANSCRIPT
![Page 1: CSEN402: Computer Organization Lecture 1: …met.guc.edu.eg/Download.ashx?id=31546&file=CSEN402_Lec1...CSEN402: Computer Organization Lecture 1: Register Transfer Level I Nada Sharaf](https://reader030.vdocuments.us/reader030/viewer/2022040409/5ec6ddd62dfa263589407d65/html5/thumbnails/1.jpg)
CSEN402: Computer OrganizationLecture 1: Register Transfer Level I
Nada Sharaf
Spring Semester 2020
Nada Sharaf Lecture 1: Introduction Spring Semester 2020 1 / 37
![Page 2: CSEN402: Computer Organization Lecture 1: …met.guc.edu.eg/Download.ashx?id=31546&file=CSEN402_Lec1...CSEN402: Computer Organization Lecture 1: Register Transfer Level I Nada Sharaf](https://reader030.vdocuments.us/reader030/viewer/2022040409/5ec6ddd62dfa263589407d65/html5/thumbnails/2.jpg)
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
![Page 3: CSEN402: Computer Organization Lecture 1: …met.guc.edu.eg/Download.ashx?id=31546&file=CSEN402_Lec1...CSEN402: Computer Organization Lecture 1: Register Transfer Level I Nada Sharaf](https://reader030.vdocuments.us/reader030/viewer/2022040409/5ec6ddd62dfa263589407d65/html5/thumbnails/3.jpg)
Credits and a Huge Thank You to Dr. MohammedEl-Mahdy
Nada Sharaf Lecture 1: Introduction Spring Semester 2020 3 / 37
![Page 4: CSEN402: Computer Organization Lecture 1: …met.guc.edu.eg/Download.ashx?id=31546&file=CSEN402_Lec1...CSEN402: Computer Organization Lecture 1: Register Transfer Level I Nada Sharaf](https://reader030.vdocuments.us/reader030/viewer/2022040409/5ec6ddd62dfa263589407d65/html5/thumbnails/4.jpg)
Tentative Grading
Assignments (project) (15%)
Quizzes (15%)
Midterm (25%)
Final (45%)
Nada Sharaf Lecture 1: Introduction Spring Semester 2020 4 / 37
![Page 5: CSEN402: Computer Organization Lecture 1: …met.guc.edu.eg/Download.ashx?id=31546&file=CSEN402_Lec1...CSEN402: Computer Organization Lecture 1: Register Transfer Level I Nada Sharaf](https://reader030.vdocuments.us/reader030/viewer/2022040409/5ec6ddd62dfa263589407d65/html5/thumbnails/5.jpg)
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
![Page 6: CSEN402: Computer Organization Lecture 1: …met.guc.edu.eg/Download.ashx?id=31546&file=CSEN402_Lec1...CSEN402: Computer Organization Lecture 1: Register Transfer Level I Nada Sharaf](https://reader030.vdocuments.us/reader030/viewer/2022040409/5ec6ddd62dfa263589407d65/html5/thumbnails/6.jpg)
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
![Page 7: CSEN402: Computer Organization Lecture 1: …met.guc.edu.eg/Download.ashx?id=31546&file=CSEN402_Lec1...CSEN402: Computer Organization Lecture 1: Register Transfer Level I Nada Sharaf](https://reader030.vdocuments.us/reader030/viewer/2022040409/5ec6ddd62dfa263589407d65/html5/thumbnails/7.jpg)
How
Study of the Basic Computer and how it works
Nada Sharaf Lecture 1: Introduction Spring Semester 2020 7 / 37
![Page 8: CSEN402: Computer Organization Lecture 1: …met.guc.edu.eg/Download.ashx?id=31546&file=CSEN402_Lec1...CSEN402: Computer Organization Lecture 1: Register Transfer Level I Nada Sharaf](https://reader030.vdocuments.us/reader030/viewer/2022040409/5ec6ddd62dfa263589407d65/html5/thumbnails/8.jpg)
Let us Start :)
Nada Sharaf Lecture 1: Introduction Spring Semester 2020 8 / 37
![Page 9: CSEN402: Computer Organization Lecture 1: …met.guc.edu.eg/Download.ashx?id=31546&file=CSEN402_Lec1...CSEN402: Computer Organization Lecture 1: Register Transfer Level I Nada Sharaf](https://reader030.vdocuments.us/reader030/viewer/2022040409/5ec6ddd62dfa263589407d65/html5/thumbnails/9.jpg)
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
![Page 10: CSEN402: Computer Organization Lecture 1: …met.guc.edu.eg/Download.ashx?id=31546&file=CSEN402_Lec1...CSEN402: Computer Organization Lecture 1: Register Transfer Level I Nada Sharaf](https://reader030.vdocuments.us/reader030/viewer/2022040409/5ec6ddd62dfa263589407d65/html5/thumbnails/10.jpg)
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
![Page 11: CSEN402: Computer Organization Lecture 1: …met.guc.edu.eg/Download.ashx?id=31546&file=CSEN402_Lec1...CSEN402: Computer Organization Lecture 1: Register Transfer Level I Nada Sharaf](https://reader030.vdocuments.us/reader030/viewer/2022040409/5ec6ddd62dfa263589407d65/html5/thumbnails/11.jpg)
Microoperations
Done in one clock cycle
R ← f (R,R)
Nada Sharaf Lecture 1: Introduction Spring Semester 2020 11 / 37
![Page 12: CSEN402: Computer Organization Lecture 1: …met.guc.edu.eg/Download.ashx?id=31546&file=CSEN402_Lec1...CSEN402: Computer Organization Lecture 1: Register Transfer Level I Nada Sharaf](https://reader030.vdocuments.us/reader030/viewer/2022040409/5ec6ddd62dfa263589407d65/html5/thumbnails/12.jpg)
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
![Page 13: CSEN402: Computer Organization Lecture 1: …met.guc.edu.eg/Download.ashx?id=31546&file=CSEN402_Lec1...CSEN402: Computer Organization Lecture 1: Register Transfer Level I Nada Sharaf](https://reader030.vdocuments.us/reader030/viewer/2022040409/5ec6ddd62dfa263589407d65/html5/thumbnails/13.jpg)
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
![Page 14: CSEN402: Computer Organization Lecture 1: …met.guc.edu.eg/Download.ashx?id=31546&file=CSEN402_Lec1...CSEN402: Computer Organization Lecture 1: Register Transfer Level I Nada Sharaf](https://reader030.vdocuments.us/reader030/viewer/2022040409/5ec6ddd62dfa263589407d65/html5/thumbnails/14.jpg)
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
![Page 15: CSEN402: Computer Organization Lecture 1: …met.guc.edu.eg/Download.ashx?id=31546&file=CSEN402_Lec1...CSEN402: Computer Organization Lecture 1: Register Transfer Level I Nada Sharaf](https://reader030.vdocuments.us/reader030/viewer/2022040409/5ec6ddd62dfa263589407d65/html5/thumbnails/15.jpg)
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
![Page 16: CSEN402: Computer Organization Lecture 1: …met.guc.edu.eg/Download.ashx?id=31546&file=CSEN402_Lec1...CSEN402: Computer Organization Lecture 1: Register Transfer Level I Nada Sharaf](https://reader030.vdocuments.us/reader030/viewer/2022040409/5ec6ddd62dfa263589407d65/html5/thumbnails/16.jpg)
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
![Page 17: CSEN402: Computer Organization Lecture 1: …met.guc.edu.eg/Download.ashx?id=31546&file=CSEN402_Lec1...CSEN402: Computer Organization Lecture 1: Register Transfer Level I Nada Sharaf](https://reader030.vdocuments.us/reader030/viewer/2022040409/5ec6ddd62dfa263589407d65/html5/thumbnails/17.jpg)
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
![Page 18: CSEN402: Computer Organization Lecture 1: …met.guc.edu.eg/Download.ashx?id=31546&file=CSEN402_Lec1...CSEN402: Computer Organization Lecture 1: Register Transfer Level I Nada Sharaf](https://reader030.vdocuments.us/reader030/viewer/2022040409/5ec6ddd62dfa263589407d65/html5/thumbnails/18.jpg)
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
![Page 19: CSEN402: Computer Organization Lecture 1: …met.guc.edu.eg/Download.ashx?id=31546&file=CSEN402_Lec1...CSEN402: Computer Organization Lecture 1: Register Transfer Level I Nada Sharaf](https://reader030.vdocuments.us/reader030/viewer/2022040409/5ec6ddd62dfa263589407d65/html5/thumbnails/19.jpg)
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
![Page 20: CSEN402: Computer Organization Lecture 1: …met.guc.edu.eg/Download.ashx?id=31546&file=CSEN402_Lec1...CSEN402: Computer Organization Lecture 1: Register Transfer Level I Nada Sharaf](https://reader030.vdocuments.us/reader030/viewer/2022040409/5ec6ddd62dfa263589407d65/html5/thumbnails/20.jpg)
Block Diagram
P : R2← R1
Nada Sharaf Lecture 1: Introduction Spring Semester 2020 20 / 37
![Page 21: CSEN402: Computer Organization Lecture 1: …met.guc.edu.eg/Download.ashx?id=31546&file=CSEN402_Lec1...CSEN402: Computer Organization Lecture 1: Register Transfer Level I Nada Sharaf](https://reader030.vdocuments.us/reader030/viewer/2022040409/5ec6ddd62dfa263589407d65/html5/thumbnails/21.jpg)
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
![Page 22: CSEN402: Computer Organization Lecture 1: …met.guc.edu.eg/Download.ashx?id=31546&file=CSEN402_Lec1...CSEN402: Computer Organization Lecture 1: Register Transfer Level I Nada Sharaf](https://reader030.vdocuments.us/reader030/viewer/2022040409/5ec6ddd62dfa263589407d65/html5/thumbnails/22.jpg)
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
![Page 23: CSEN402: Computer Organization Lecture 1: …met.guc.edu.eg/Download.ashx?id=31546&file=CSEN402_Lec1...CSEN402: Computer Organization Lecture 1: Register Transfer Level I Nada Sharaf](https://reader030.vdocuments.us/reader030/viewer/2022040409/5ec6ddd62dfa263589407d65/html5/thumbnails/23.jpg)
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
![Page 24: CSEN402: Computer Organization Lecture 1: …met.guc.edu.eg/Download.ashx?id=31546&file=CSEN402_Lec1...CSEN402: Computer Organization Lecture 1: Register Transfer Level I Nada Sharaf](https://reader030.vdocuments.us/reader030/viewer/2022040409/5ec6ddd62dfa263589407d65/html5/thumbnails/24.jpg)
Register Transfer Symbols
Nada Sharaf Lecture 1: Introduction Spring Semester 2020 24 / 37
![Page 25: CSEN402: Computer Organization Lecture 1: …met.guc.edu.eg/Download.ashx?id=31546&file=CSEN402_Lec1...CSEN402: Computer Organization Lecture 1: Register Transfer Level I Nada Sharaf](https://reader030.vdocuments.us/reader030/viewer/2022040409/5ec6ddd62dfa263589407d65/html5/thumbnails/25.jpg)
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
![Page 26: CSEN402: Computer Organization Lecture 1: …met.guc.edu.eg/Download.ashx?id=31546&file=CSEN402_Lec1...CSEN402: Computer Organization Lecture 1: Register Transfer Level I Nada Sharaf](https://reader030.vdocuments.us/reader030/viewer/2022040409/5ec6ddd62dfa263589407d65/html5/thumbnails/26.jpg)
Bus System
Multiple sources and destinations
Bus ← R
Nada Sharaf Lecture 1: Introduction Spring Semester 2020 26 / 37
![Page 27: CSEN402: Computer Organization Lecture 1: …met.guc.edu.eg/Download.ashx?id=31546&file=CSEN402_Lec1...CSEN402: Computer Organization Lecture 1: Register Transfer Level I Nada Sharaf](https://reader030.vdocuments.us/reader030/viewer/2022040409/5ec6ddd62dfa263589407d65/html5/thumbnails/27.jpg)
Multiplexer
f depends on the value of the selection lines
Nada Sharaf Lecture 1: Introduction Spring Semester 2020 27 / 37
![Page 28: CSEN402: Computer Organization Lecture 1: …met.guc.edu.eg/Download.ashx?id=31546&file=CSEN402_Lec1...CSEN402: Computer Organization Lecture 1: Register Transfer Level I Nada Sharaf](https://reader030.vdocuments.us/reader030/viewer/2022040409/5ec6ddd62dfa263589407d65/html5/thumbnails/28.jpg)
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
![Page 29: CSEN402: Computer Organization Lecture 1: …met.guc.edu.eg/Download.ashx?id=31546&file=CSEN402_Lec1...CSEN402: Computer Organization Lecture 1: Register Transfer Level I Nada Sharaf](https://reader030.vdocuments.us/reader030/viewer/2022040409/5ec6ddd62dfa263589407d65/html5/thumbnails/29.jpg)
Bus System with Multiplexers
Nada Sharaf Lecture 1: Introduction Spring Semester 2020 29 / 37
![Page 30: CSEN402: Computer Organization Lecture 1: …met.guc.edu.eg/Download.ashx?id=31546&file=CSEN402_Lec1...CSEN402: Computer Organization Lecture 1: Register Transfer Level I Nada Sharaf](https://reader030.vdocuments.us/reader030/viewer/2022040409/5ec6ddd62dfa263589407d65/html5/thumbnails/30.jpg)
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
![Page 31: CSEN402: Computer Organization Lecture 1: …met.guc.edu.eg/Download.ashx?id=31546&file=CSEN402_Lec1...CSEN402: Computer Organization Lecture 1: Register Transfer Level I Nada Sharaf](https://reader030.vdocuments.us/reader030/viewer/2022040409/5ec6ddd62dfa263589407d65/html5/thumbnails/31.jpg)
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
![Page 32: CSEN402: Computer Organization Lecture 1: …met.guc.edu.eg/Download.ashx?id=31546&file=CSEN402_Lec1...CSEN402: Computer Organization Lecture 1: Register Transfer Level I Nada Sharaf](https://reader030.vdocuments.us/reader030/viewer/2022040409/5ec6ddd62dfa263589407d65/html5/thumbnails/32.jpg)
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
![Page 33: CSEN402: Computer Organization Lecture 1: …met.guc.edu.eg/Download.ashx?id=31546&file=CSEN402_Lec1...CSEN402: Computer Organization Lecture 1: Register Transfer Level I Nada Sharaf](https://reader030.vdocuments.us/reader030/viewer/2022040409/5ec6ddd62dfa263589407d65/html5/thumbnails/33.jpg)
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
![Page 34: CSEN402: Computer Organization Lecture 1: …met.guc.edu.eg/Download.ashx?id=31546&file=CSEN402_Lec1...CSEN402: Computer Organization Lecture 1: Register Transfer Level I Nada Sharaf](https://reader030.vdocuments.us/reader030/viewer/2022040409/5ec6ddd62dfa263589407d65/html5/thumbnails/34.jpg)
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
![Page 35: CSEN402: Computer Organization Lecture 1: …met.guc.edu.eg/Download.ashx?id=31546&file=CSEN402_Lec1...CSEN402: Computer Organization Lecture 1: Register Transfer Level I Nada Sharaf](https://reader030.vdocuments.us/reader030/viewer/2022040409/5ec6ddd62dfa263589407d65/html5/thumbnails/35.jpg)
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
![Page 36: CSEN402: Computer Organization Lecture 1: …met.guc.edu.eg/Download.ashx?id=31546&file=CSEN402_Lec1...CSEN402: Computer Organization Lecture 1: Register Transfer Level I Nada Sharaf](https://reader030.vdocuments.us/reader030/viewer/2022040409/5ec6ddd62dfa263589407d65/html5/thumbnails/36.jpg)
References
Chapter 4
Nada Sharaf Lecture 1: Introduction Spring Semester 2020 36 / 37
![Page 37: CSEN402: Computer Organization Lecture 1: …met.guc.edu.eg/Download.ashx?id=31546&file=CSEN402_Lec1...CSEN402: Computer Organization Lecture 1: Register Transfer Level I Nada Sharaf](https://reader030.vdocuments.us/reader030/viewer/2022040409/5ec6ddd62dfa263589407d65/html5/thumbnails/37.jpg)
Thank you :)
Nada Sharaf Lecture 1: Introduction Spring Semester 2020 37 / 37