מבוסס על הרצאות של יורם זינגר, האוניברסיטה העברית י"ם

Slides:



Advertisements
Similar presentations
Another Implementation Style
Advertisements

1  1998 Morgan Kaufmann Publishers Summary:. 2  1998 Morgan Kaufmann Publishers How many cycles will it take to execute this code? lw $t2, 0($t3) lw.
A. Abhari CPS2131 Sequential Circuits Most digital systems like digital watches, digital phones, digital computers, digital traffic light controllers and.
1 זכרון 1 2 Q’ Q זכרון Q’ Q = = 1 קלט פלט קלט פלט 0.
331 W08.1Spring :332:331 Computer Architecture and Assembly Language Spring 2006 Week 8: Datapath Design [Adapted from Dave Patterson’s UCB CS152.
Circuits require memory to store intermediate data
Dr. ClincyLecture1 Appendix A – Part 2: Logic Circuits Current State or output of the device is affected by the previous states Circuit Flip Flops New.
1 Lecture 23 More Sequential Circuits Analysis. 2 Analysis of Combinational Vs. Sequential Circuits °Combinational : Boolean Equations Truth Table Output.
מבוסס על הרצאות של יורם זינגר, האוניברסיטה העברית י"ם
מערכות זיכרון – Sequential Logic Combinatorial Circuit מעגל צירופי Storage/Mem יחידה זיכרון עד כה טיפלנו במערכות צירופיות שהינן חסרות " זיכרון " או מצב.
מערכות זיכרון – Sequential Logic
Finite State Machines מבוסס על הרצאות של יורם זינגר, האוניברסיטה העברית י"ם יהודה אפק, נתן אינטרטור אוניברסיטת תל אביב.
1 Chapter Five The Processor: Datapath and Control.
1 The single cycle CPU. 2 Performance of Single-Cycle Machines Memory Unit 2 ns ALU and Adders 2 ns Register file (Read or Write) 1 ns Class Fetch Decode.
1 Copyright 1998 Morgan Kaufmann Publishers, Inc. All rights reserved. The single cycle CPU.
Processor Design 5Z032 Processor: Datapath and Control Chapter 5 Henk Corporaal Eindhoven University of Technology 2009.
Microprogramming Andreas Klappenecker CPSC321 Computer Architecture.
CS 161Computer Architecture Chapter 5 Lecture 12
1 Chapter Five. 2 We're ready to look at an implementation of the MIPS Simplified to contain only: –memory-reference instructions: lw, sw –arithmetic-logical.
1  1998 Morgan Kaufmann Publishers & Ing-Jer Huang Chapter Five last upate: 6/24/2015.
1 The single cycle CPU. 2 Performance of Single-Cycle Machines Memory Unit 2 ns ALU and Adders 2 ns Register file (Read or Write) 1 ns Class Fetch Decode.
Preparation for Midterm Binary Data Storage (integer, char, float pt) and Operations, Logic, Flip Flops, Switch Debouncing, Timing, Synchronous / Asynchronous.
Advanced Computer Architecture 5MD00 / 5Z033 MIPS Design data path and control Henk Corporaal TUEindhoven 2007.
Registers and Counters
Chapter Five The Processor: Datapath and Control.
משטר דינמי – © Dima Elenbogen :14. הגדרת cd ו -pd cd - הזמן שעובר בין הרגע שראשון אותות הכניסה יוצא מתחום לוגי עד אשר אות המוצא יוצא מתחום.
1  1998 Morgan Kaufmann Publishers We're ready to look at an implementation of the MIPS Simplified to contain only: –memory-reference instructions: lw,
Class 9.1 Computer Architecture - HUJI Computer Architecture Class 9 Microprogramming.
1 We're ready to look at an implementation of the MIPS Simplified to contain only: –memory-reference instructions: lw, sw –arithmetic-logical instructions:
The Processor Andreas Klappenecker CPSC321 Computer Architecture.
1 ׃1998 Morgan Kaufmann Publishers פקודת ה- jump 4 bits 26 bits 2 bits 00 : כתובת קפיצה במילים : כתובת קפיצה בבתים … …
Computing Systems The Processor: Datapath and Control.
George Mason University Finite State Machines Based on lectures from George Mason and CMU יהודה אפק, נתן אינטרטור אוניברסיטת תל אביב.
1 For some program running on machine X, Performance X = 1 / Execution time X "X is n times faster than Y" Performance X / Performance Y = n Problem:
Chapter 5 Processor Design. Spring 2005 ELEC 5200/6200 From Patterson/Hennessey Slides We're ready to look at an implementation of the MIPS Simplified.
EECS 322: Computer Architecture
1 Computer Organization & Design Microcode for Control Sec. 5.7 (CDROM) Appendix C (CDROM) / / pdf / lec_3a_notes.pdf.
CPE232 Basic MIPS Architecture1 Computer Organization Multi-cycle Approach Dr. Iyad Jafar Adapted from Dr. Gheith Abandah slides
Overview of Control Hardware Development
1  1998 Morgan Kaufmann Publishers Value of control signals is dependent upon: –what instruction is being executed –which step is being performed Use.
Multicycle Implementation
Synchronous Sequential Logic Part I
COM181 Computer Hardware Lecture 6: The MIPs CPU.
1  2004 Morgan Kaufmann Publishers No encoding: –1 bit for each datapath operation –faster, requires more memory (logic) –used for Vax 780 — an astonishing.
CDA 3101 Spring 2016 Introduction to Computer Organization Microprogramming and Exceptions 08 March 2016.
1. 2 MIPS Hardware Implementation Full die photograph of the MIPS R2000 RISC Microprocessor. The 1986 MIPS R2000 with five pipeline stages and 450,000.
Sequential logic circuits First Class 1Dr. AMMAR ABDUL-HAMED KHADER.
Design a MIPS Processor (II)
CS161 – Design and Architecture of Computer Systems
CS161 – Design and Architecture of Computer Systems
Chapter 5 The Processor: Datapath and Control
Computer Organization & Design Microcode for Control Sec. 5
Digital Design Lecture 9
Sequential Circuits Most digital systems like digital watches, digital phones, digital computers, digital traffic light controllers and so on require.
Processor (I).
Multiple Cycle Implementation of MIPS-Lite CPU
Chapter Five.
COSC 2021: Computer Organization Instructor: Dr. Amir Asif
מבוסס על הרצאות של יורם זינגר, האוניברסיטה העברית י"ם
Processor: Finite State Machine & Microprogramming
Computer Architecture
אוגרים ומונים – Registers & Counters
Chapter Five The Processor: Datapath and Control
Chapter Five The Processor: Datapath and Control
Control Unit Introduction Types Comparison Control Memory
The Processor Lecture 3.1: Introduction & Logic Design Conventions
Processor (II).
Multi-Cycle Datapath Lecture notes from MKP, H. H. Lee and S. Yalamanchili.
Chapter Four The Processor: Datapath and Control
Presentation transcript:

מבוסס על הרצאות של יורם זינגר, האוניברסיטה העברית י"ם Flip Flop יהודה אפק, יוסי מטיאס אוניברסיטת תל אביב מבוסס על הרצאות של יורם זינגר, האוניברסיטה העברית י"ם

מערכות זיכרון – Sequential Logic Input כניסות Combinatorial Circuit מעגל צירופי Output יציאות Storage/Mem יחידה זיכרון עד כה טיפלנו במערכות צירופיות שהינן חסרות "זיכרון" או מצב.  שינוי בערכי הכניסה גורר שינוי "מיידי" (לאחר השהייה) בערכי היציאה. כל מחשב וכן בקרים מתוכנתים (Controllers) מכילים זיכרון המשמש לשמירת נתונים ולביצוע תוכניות. פרט למבנים כמו SDRAM,ROM וזיכרון בועות (Bubble memory), "הזיכרון" מושג ע"י שימוש במשוב (feedback) של יחידות לוגיות.

Synchronous Sequential Circuits פעולת המערכת מתבצעת ב"פיקודו" של שעון וערכי המערכת נקבעים מערכי הכניסה בנקודות זמן מסוימות שהינן תלויות שעון  מצב המערכת תלוי בשעון. Asynchronous Sequential Circuits פעולות המערכת תלויות בסדר של שינוי הכניסות, מצב המערכת יכול להשתנות בכל רגע. "יציב" "מהיר" Combinatorial Circuit Memory Clock Pulses

L A T C H S R – L a t c h 1 R Q Q’ S R Q Q’ S 1 2 Reset Set O  1  1  Reset Set R S 1 Q 1 1 2 Q’

זכרון 1 Q 1 1 2 Q’

זכרון = = קלט 1 פלט 1 פלט קלט 1 Q 1 1 2 Q’

זכרון Reset Set R S 1 Q 1 1 2 Q’

L A T C H 1 2 S R – L a t c h Reset Set R S Q’ Q O  1 1 

L A T C H 1 2 S R – L a t c h Reset Set R S Q’ Q 1

L A T C H S R – L a t c h 1 R Q Q’ S מקודם Reset (1) 1 (0) 2 Set (0) 1 (1) מקודם נניח שניתנה פקודת Set  S=1, R=0 ועתה אנו "מורידים" את הכניסות (S=0, R=0). ערכי היציאה Q’, Q "זוכרים" את פקודת ה-Set. באותו אופן יזכרו את ה - Reset.

L A T C H S R – L a t c h R S Q’ Q 1 Reset 1 2 Set R=1, S=1 כאשר הערכים יורדים ל – "0" (S=0, R=0) הערך של Q ו Q’ תלוי באיזה קו ישתנה ראשון RACE Condition  המצב הבא נקרא לא מוגדר. 1

דיאגרמת זמנים: טבלת אמת – מצבים: Reset State Set State Undefined "1" Q "0" "1" S "0" "1" R "0" טבלת אמת – מצבים: S R Q Q’ 1 Reset State Set State Undefined (מצב אסור) Latch איננו פונקציה בוליאנית. ערכי היציאה תלויים בפעולת Set או Reset האחרונה. עבור כניסות (0,0) ערך היציאה נשמר קבוע כל זמן שיש מתח.

SR Latch with NAND R Q Q’ S Set State Reset State Undefined 1 R S Q’ Q 1 S R Q’ Q 1 Set State Reset State Undefined 1 Set Command Reset Command

SR Latch with NAND R Q Q’ S Set State Reset State Undefined 1 R S Q’ Q 1 S R Q’ Q 1 Set State Reset State Undefined 1 Set Command Reset Command

SR Latch מבוקר שעון: R Q CP Q’ S R 1 1 S S R CP Q Clock Pulse C S R Clock Pulse S R CP Q C S R Next Q  No change 1 Q = 1 Q = 0 Undef

D (data) Latch D Q CP Q’ Latch D הינו יחידה שאוגרת / "זוכרת" ביט יחיד. 1 D Q’ Q CP 1 D' Q = 1 (Set) Q = 0 (Reset) No change Next State of Q 1  C D Latch D הינו יחידה שאוגרת / "זוכרת" ביט יחיד. נמנעים ממצב לא מוגדר. אבן בניין בסיסית של אוגרים (Registers).

D Latch אינו מספיק !! Input כניסות Combinatorial Circuit מעגל צירופי Output יציאות D Q’ Q CP מחזור שעון ארוך והמעגל יחליף את מצבו מספר פעמים !!!!

Flip - Flops הזמן שלוקח עד שהמוצא של Latch מתייצב יכול ליצור בעיות כאשר מחברים שתי יחידות זיכרון. המוצא אינו צריך להיות תלוי בתזמון וצריך להימנע "ממצבים מתהפכים" (JK). פתרון צריך לדאוג שהמוצא יהיה יציב לפרק זמן מובטח. Flip-Flop פתרון מבוסס על Latch: שימוש בשני Latch בצורה שתבטיח שהפלט יהיה מבודד מהכניסות המשתנות: Master-Slave Flip-Flop

Master – Slave Flip - Flop C Q Q’ ג ב ר ת ע ב ד M Y Y’ כאשר (master) M פעיל S (slave) אינו פעיל והינו זוכר את היציאות של M מהשלב ש – M היה סביל. C S Y Q אין השפעה!

Master – Slave Flip - Flop 1 10 01 נשאר 1 נעשה פעיל S R C Q Q’ ג ב ר ת ע ב ד M Y Y’ כאשר M פעיל S אינו פעיל והינו זוכר את היציאות של M מהשלב ש – M היה סביל. C S Y Q אין השפעה!

D Flip Flop כן מספיק !! Input Combinatorial כניסות Circuit מעגל צירופי S Y S S R C Q Q’ ג ב ר ת S R C Q Q’ ע ב ד Q Y’ R Q’ C

JK Latch "עידון" של SR Latch: K Q CP Q’ J 1 3 4 2 כאשר K = 0 , J = 1 : א) המשוב מ – Q לתוך שער 1 לא משפיע היות ו – K=0. ב) כניסות לשער 3 הינם 0,0  Q=1  Q’=0. כאשר K=1, J=0 נקבל Q’=1 Q=0. כאשר K=1, J=1 ?

JK Latch "עידון" של SR Latch: K Q CP Q’ J ("חדש") 1 (חדש) 1 3 1 1 1 ("חדש") 1 ("חדש") 0 (ישן) 1 1 (חדש) (ישן) Q=0 K=0 J=1 a JK Latch "עידון" של SR Latch: K J Q’ Q CP 3 4 1 2 כאשר CP=0 אין שינוי מצב כמקודם. כאשר K = 0 , J = 1 : א) המשוב מ – Q לתוך שער 1 לא משפיע היות ו – K=0. ב) כניסות לשער 3 הינם 0,0  Q=1  Q’=0. כאשר K=1, J=0 נקבל Q’=1 Q=0. כאשר K=1, J=1 ?

JK Latch "עידון" של SR Latch: K Q CP Q’ J המצב "נשמר" 1 1 3 4 2 ("ישן") 0 (ישן) 1 Q=0 K=1 J=0 b (ישן) המצב "נשמר" או Reset JK Latch "עידון" של SR Latch: K J Q’ Q CP 3 4 1 2 כאשר CP=0 אין שינוי מצב כמקודם. כאשר K = 0 , J = 1 : א) המשוב מ – Q לתוך שער 1 לא משפיע היות ו – K=0. ב) כניסות לשער 3 הינם 0,0  Q=1  Q’=0. כאשר K=1, J=0 נקבל Q’=1 Q=0. כאשר K=1, J=1 ?

JK Latch "עידון" של SR Latch: K Q CP Q’ J 1 1 3 (1) 4 2 (0) אם 1=J=K=C לאורך זמן מצב Q יתהפך עוד ועוד.  מעברים חוזרים ונשנים. 1 (0) (1) K=1 J=1 c JK Latch "עידון" של SR Latch: K J Q’ Q CP 3 4 1 2 כאשר CP=0 אין שינוי מצב כמקודם. כאשר K = 0 , J = 1 : א) המשוב מ – Q לתוך שער 1 לא משפיע היות ו – K=0. ב) כניסות לשער 3 הינם 0,0  Q=1  Q’=0. כאשר K=1, J=0 נקבל Q’=1 Q=0. כאשר K=1, J=1 ?

טבלת אמת עבור JK: דיאגרמת זמנים: Q(t) J K Q(t+1) 1 דיאגרמת זמנים: J K CP Q Q יתהפך בין 0 ל –1 הלוך ושוב כל זמן ש – cp=1

T (trigger) Latch מתקבל ע"י חיבור J,K ב JK-Latch למקור אחד: T = 0  J = K = 0 אין שינוי במצב T = 1  J = K = 1 היפוך מצב היפוך זה יחיד אם משך הזמן בו T = 1 הינו "קצר" Qt T Qt+1 1 Qt D Qt+1 1

JK Flip-Flop: Slave Master J K Q’ Y1 Y0 01 1 10 10 0 (0) (1) C Q SR Latch D Slave Master J K Q’ Y1 Y0 01 1 10 10 0 (0) (1) כאשר J = K = 1 היציאה Q הינה קבועה. עם עליית השעון ה Master יהפוך מצב (Y התהפך). Q ישאר קבוע כל זמן שהשעון הינו "1" ו – Y ישאר קבוע לאחר עליית השעון. עם ירידת השעון הערך של Y יוכנס ל – D Latch ו – Q ישתנה.

T (trigger) Flip-Flop D (data) Flip-Flop Slave Master Q’ Y T C Q SR Latch D Slave Master Q’ Y T Q(t) Q’(t+1) Q(t) Q(t) T=1 T=0 D (data) Flip-Flop D C Latch Slave Master Q Y Q(t+1)  D(t)

טבלאות המצבים: JKFF SRFF DFF TFF t Q(t) t+1 Q(t) שינוי של קלט שינוי של פלט JKFF SRFF J K Q(t+1) Q(t) No Change 1 Reset Set Q’(t) Complement S R Q(t+1) Q(t) No Change 1 Reset Set ? Undef. DFF TFF D Q(t+1) Reset 1 Set T Q(t+1) Q(t) No Change 1 Q’(t) Complement

Finite State Machine (FSM) 00/0 01/0 11/0 10/1 1 =Iקלט (כמקודם) =Oפלט האוטומט פולט 1 אחרי ש"ראה" לפחות 3 1-ים מאז ה- 0 האחרון. פלט מצוייר במצבים Moore FSM

Finite State Machine (FSM) 0/0 קלט (כמקודם) 00 1/0 0/0 01 0/0 0/0 1/0 10 פלט 1/1 11 1/1 האוטומט פולט 1 אחרי ש"ראה" לפחות 3 1-ים מאז ה- 0 האחרון. פלט מצוייר על הקשתות Mealy FSM

טבלת המצבים –Moore הפלט תלוי ב – A & B At Bt I=0 I=1 At+1 Bt+1 Ot 1 00/0 At Bt I=0 I=1 At+1 Bt+1 Ot 1 1 01/0 1 11/0 1 10/1 1 הפלט תלוי ב – A & B

טבלת המצבים - Mealy At Bt X=0 X=1 At+1 Bt+1 Ot 1 הפלט תלוי ב - X

טבלת המצבים – Moore At Bt I=0 I=1 At+1 Bt+1 Ot 1 10 11 01 00 Bt+1 1 10 00/0 01/0 11/0 10/1 1 טבלת המצבים – Moore At Bt I=0 I=1 At+1 Bt+1 Ot 1 AB AB 10 11 01 00 Bt+1 1 10 11 01 00 At+1 1 I

דוגמא - Moore A B כניסה אחת ויציאה אחת 2FF מסוג Data  4 מצבים. I O Q A Q’ O D Q B Q’ At+1= A*I + B * I= I(A+B) Bt+1= A*I כניסה אחת ויציאה אחת 2FF מסוג Data  4 מצבים. O = A*B

דוגמא – Mealy A X Out B כניסה אחת ויציאה אחת D Q A Q’ X Out D Q B Q’ כניסה אחת ויציאה אחת היציאה תלויה ב- QA, QB ו- X. 2FF מסוג Data  4 מצבים.

Moore Vs. Mealy פלט: אוטומט: שיקולים: Moore שקול ל – Mealy (ולהפך) Moore – לא תלוי ב"יציבות" הקלט (מספיק שיהיה קבוע Ts + Th) אך ידרשו FFs נוספים אם דרושה תלות היציאה בקלט. Mealy – פשוט לממוש אם יש תלות של היציאה בקלט אך נדרשת יציבות. Moore שקול ל – Mealy (ולהפך)

נוהל עיצוב הגדר במילים את פעולת המעגל. בנה את טבלת המצבים (אוטומט) צמצם / מצא ייצוג קטן של אוטומט המצבים. קבע משתנים אשר ייצגו את המצבים (בצורה וקטורית). קבע את מספר הדלגלגים והתאם אות לכל דלגלג. בחר בסוג הדלגלג להשתמש בו. קבל טבלאות העירור והיציאות של המעגל מטבלת המצבים. חשב את פונקציות היציאה של המעגל ואת פונקציות הכניסה של FF (בעזרת מפות קרנו או כל שיטה אחרת) צייר הדיאגרמה הלוגית. *

דוגמת תכנון "תקין" "תקין" "שמאלה" "ימינה" מערב "שמאלה" מרכז "ימינה" I Robot "תקין" "תקין" "שמאלה" "ימינה" מערב "שמאלה" מרכז "ימינה" מזרח "תקין" "תקין" "שמאלה" "ימינה" "תקוע" "תקוע"

אוטומט המצבים – תיאור סמלי: מרכז תקין / שמאל תקין / ימין תקין / ימין תקוע / שמאל תקין / שמאל מזרח מערב תקוע / ימין

00 10 01 אוטומט המצבים: תקין : 0 תקוע : 1 "ימין" : 0 "שמאל" : 1 תקין : 0 תקוע : 1 "ימין" : 0 "שמאל" : 1 המצב הנוכחי קלט X המצב הבא פלט Y A B 1 A B 00 0/0 1/0 קלט מרכז 1/1 10 01 1/0 0/0 פלט מזרח מערב 0/1 3 מצבים נזדקק ל – 2FF 2FF יכולים "לזכור" 4 מצבים. מצב שלא משתמשים בו ("11")

טבלת המצבים + מעברים: המצב הנוכחי קלט X המצב הבא פלט Y A B 1

פונקציות יציאה + מצב הבא: מימוש עבור D-FF Bt 1  A(t+1) = B’X’ = (B+X)’ At Xt Bt 1  B(t+1) = A’X At Xt Bt 1  Y(t) = AX’ + BX At Xt

מימוש עבור DFF (שעון מושמט) דיאגרמה לוגית: AX’ X D Q B’X’ A C Q’ y D Q A’X B BX C Q’ מימוש עבור DFF (שעון מושמט)

Graphical Specification of FSM How many state bits will we need? חובר בספטמבר 2001

Finite State Machine for Control 0 0 0 0 0 1 1 0 0 1 1 1 0 0 0 1 0 1 1 0 0 0 1 1 1 0 0 0 1 0 0 0 0 0 0 1 0 1 0 0 0 1 1 1 0 0 1 1 0 1 1 1 0 1 1 1 חובר בספטמבר 2001

The control signals decoder We just implement the table of slide 54: Let’s look at ALUSrcA: it is “0” in states 0 and 1 and it is “1” in states 2, 6 and 8. In all other states we don’t care. let’s look at PCWrite: it is “1” in states 0 and 9. In all other states it must be “0”. And so, we’ll fill the table below and build the decoder. S3 S2 S1 S0 ALUSrcA state Control signals 1 X PCWrite All other combinations PCWriteCond fetch decode AdrCmp load WB store ALU WBR branch jump

The state machine “next state calc.” logic IR31 IR30 IR29 IR28 IR27 IR26 opcode S3 S2 S1 S0 current state next state X 1 Fetch Jump 9 WBR 7 Load 3 Branch 8 ALU 6 AdrCmp 2 Store 5 Decode 1 WB 4 lw+sw R-type beq j sw lw R-type lw+sw lw sw R-type=000000, lw=100011, sw=101011, beq=000100, bne=000101, lui=001111, j=0000010, jal=000011, addi=001000

Interrupt and exception Type of event From Where ? MIPS terminology Interrupt External I/O device request ------------------------------------------------------------------------------------ Invoke Operation system Internal Exception From user program ------------------------------------------------------------------------------------- Arithmetic Overflow Internal Exception Using an undefined Instruction Internal Exception -------------------------------------------------------------------------------------- Hardware malfunctions Either Exception or interrupt חובר בספטמבר 2001

Exceptions handling Exception type Exception vector address (in hex) Undefined instruction c0 00 00 00 Arithmetic Overflow c0 00 00 20 We have 2 ways to handle exceptions: Cause register or Vectored interrupts MIPS – Cause register חובר בספטמבר 2001

Handling exceptions

Handling exceptions חובר בספטמבר 2001

Handling interrupts: Jump WBR Load ALU Store WB 1 5 2 8 6 9 7 4 3 Fetch Jump WBR Load Branch ALU AdrCmp Store Decode WB 1 5 2 8 6 9 7 4 3 lw+sw R-type beq j sw lw SavePC 10 IRET JumpInt 11

PLA Implementation If I picked a horizontal or vertical line could you explain it? חובר בספטמבר 2001

ROM Implementation ROM = "Read Only Memory" values of memory locations are fixed ahead of time A ROM can be used to implement a truth table if the address is m-bits, we can address 2m entries in the ROM. our outputs are the bits of data that the address points to. m is the "heigth", and n is the "width" 0 0 0 0 0 1 1 0 0 1 1 1 0 0 0 1 0 1 1 0 0 0 1 1 1 0 0 0 1 0 0 0 0 0 0 1 0 1 0 0 0 1 1 1 0 0 1 1 0 1 1 1 0 1 1 1 m n חובר בספטמבר 2001

ROM Implementation How many inputs are there? 6 bits for opcode, 4 bits for state = 10 address lines (i.e., 210 = 1024 different addresses) How many outputs are there? 16 datapath-control outputs, 4 state bits = 20 outputs ROM is 210 x 20 = 20K bits (and a rather unusual size) Rather wasteful, since for lots of the entries, the outputs are the same — i.e., opcode is often ignored חובר בספטמבר 2001

ROM vs PLA Break up the table into two parts — 4 state bits tell you the 16 outputs, 24 x 16 bits of ROM — 10 bits tell you the 4 next state bits, 210 x 4 bits of ROM — Total: 4.3K bits of ROM PLA is much smaller — can share product terms — only need entries that produce an active output — can take into account don't cares Size is (#inputs ´ #product-terms) + (#outputs ´ #product-terms) For this example = (10x17)+(20x17) = 460 PLA cells PLA cells usually about the size of a ROM cell (slightly bigger) חובר בספטמבר 2001

Microprogramming What are the “microinstructions” ? חובר בספטמבר 2001

Microprogramming A specification methodology appropriate if hundreds of opcodes, modes, cycles, etc. signals specified symbolically using microinstructions Will two implementations of the same architecture have the same microcode? What would a microassembler do? חובר בספטמבר 2001

Details חובר בספטמבר 2001

Microinstruction format חובר בספטמבר 2001

Maximally vs. Minimally Encoded No encoding: 1 bit for each datapath operation faster, requires more memory (logic) used for Vax 780 — an astonishing 400K of memory! Lots of encoding: send the microinstructions through logic to get control signals uses less memory, slower Historical context of CISC: Too much logic to put on a single chip with everything else Use a ROM (or even RAM) to hold the microcode It’s easy to add new instructions חובר בספטמבר 2001

Microcode: Trade-offs Distinction between specification and implementation is sometimes blurred Specification Advantages: Easy to design and write Design architecture and microcode in parallel Implementation (off-chip ROM) Advantages Easy to change since values are in memory Can emulate other architectures Can make use of internal registers Implementation Disadvantages, SLOWER now that: Control is implemented on same chip as processor ROM is no longer faster than RAM No need to go back and make changes חובר בספטמבר 2001

“Macro and micro - instruction” Interpretation User program plus Data this can change! Main Memory ADD SUB AND . one of these is mapped into one of these DATA execution unit CPU control memory AND microsequence e.g., Fetch Calc Operand Addr Fetch Operand(s) Calculate Save Answer(s)

The Big Picture חובר בספטמבר 2001

Edge Triggered Flip-Flops דלגלגים מדורבני קצה: Edge Triggered Flip-Flops שינוי המצב מתבצע עם שינוי השעון ומתייצב אח"כ. דופק ושעון חיובי קצה חיובי קצה שלילי דופק ושעון שלילי קצה שלילי קצה חיובי Ts-Setup Time CP Ts Tn Th-Holdup Time D יציב Ts+Tn

כניסות ישירות: Direct Inputs כאשר המתח במעגל ספרתי "עולה" המצב של Flip Flops איננו מוגדר לכן יש לבצע אתחול. אתחול מבוצע ע"י כניסות ישירות אשר קובעות ישירות את המצב (Preset). preset / clear J Q CP K Q’ PreSet CP J K Q Q’  1  no change flip state

מעגלים סדרתיים – תזמון: דוגמא: MSJFF MSJFF YA YB  J Q J Out A B Q CP CP K Q’ K Q’ Out(t) D(t-2)  2JKFF  CP YA QA YB QB