Reference Sheet for C112 Hardware

Similar documents
A 32-bit Processor: Sequencing and Output Logic

REGISTER TRANSFER LANGUAGE

SHRI ANGALAMMAN COLLEGE OF ENGINEERING. (An ISO 9001:2008 Certified Institution) SIRUGANOOR, TIRUCHIRAPPALLI

CONTENTS CHAPTER 1: NUMBER SYSTEM. Foreword...(vii) Preface... (ix) Acknowledgement... (xi) About the Author...(xxiii)

COMPUTER ARCHITECTURE AND ORGANIZATION Register Transfer and Micro-operations 1. Introduction A digital system is an interconnection of digital

CS 31: Intro to Systems Digital Logic. Kevin Webb Swarthmore College February 3, 2015

END-TERM EXAMINATION

SUBJECT CODE: IT T35 DIGITAL SYSTEM DESIGN YEAR / SEM : 2 / 3

DIGITAL ELECTRONICS. Vayu Education of India

UNIT-III REGISTER TRANSFER LANGUAGE AND DESIGN OF CONTROL UNIT

CS 31: Intro to Systems Digital Logic. Kevin Webb Swarthmore College February 2, 2016

Parallel logic circuits

(ii) Simplify and implement the following SOP function using NOR gates:

EE 3170 Microcontroller Applications

IA Digital Electronics - Supervision I

Chapter 6. CMOS Functional Cells

Code No: R Set No. 1

II/IV B.Tech (Regular/Supplementary) DEGREE EXAMINATION. Answer ONE question from each unit.

UPY14602-DIGITAL ELECTRONICS AND MICROPROCESSORS Lesson Plan

HANSABA COLLEGE OF ENGINEERING & TECHNOLOGY (098) SUBJECT: DIGITAL ELECTRONICS ( ) Assignment

Code No: R Set No. 1

INSTITUTE OF AERONAUTICAL ENGINEERING Dundigal, Hyderabad ELECTRONICS AND COMMUNICATIONS ENGINEERING

Injntu.com Injntu.com Injntu.com R16

COPYRIGHTED MATERIAL INDEX

BUILDING BLOCKS OF A BASIC MICROPROCESSOR. Part 1 PowerPoint Format of Lecture 3 of Book

6.1 Combinational Circuits. George Boole ( ) Claude Shannon ( )

MLR Institute of Technology

Code No: R Set No. 1

COLLEGE OF ENGINEERING DEPARTMENT OF ELECTRICAL AND ELECTRONICS ENGINEERING QUESTION BANK SUBJECT CODE & NAME: EC 1312 DIGITAL LOGIC CIRCUITS UNIT I

Principles of Digital Techniques PDT (17320) Assignment No State advantages of digital system over analog system.

Register Transfer and Micro-operations

Let s put together a Manual Processor

UNIT - V MEMORY P.VIDYA SAGAR ( ASSOCIATE PROFESSOR) Department of Electronics and Communication Engineering, VBIT

REGISTER TRANSFER AND MICROOPERATIONS

Henry Lin, Department of Electrical and Computer Engineering, California State University, Bakersfield Lecture 7 (Digital Logic) July 24 th, 2012

6.1 Combinational Circuits. George Boole ( ) Claude Shannon ( )

Hours / 100 Marks Seat No.

St.MARTIN S ENGINEERING COLLEGE Dhulapally, Secunderabad

10EC33: DIGITAL ELECTRONICS QUESTION BANK

COSC 243. Computer Architecture 1. COSC 243 (Computer Architecture) Lecture 6 - Computer Architecture 1 1

CHAPTER 4: Register Transfer Language and Microoperations

Digital logic fundamentals. Question Bank. Unit I

Chapter 1: Basics of Microprocessor [08 M]

Chapter 6 (Lect 3) Counters Continued. Unused States Ring counter. Implementing with Registers Implementing with Counter and Decoder

VALLIAMMAI ENGINEERING COLLEGE. SRM Nagar, Kattankulathur DEPARTMENT OF ELECTRONICS AND COMMUNICATION ENGINEERING EC6302 DIGITAL ELECTRONICS

1 MALP ( ) Unit-1. (1) Draw and explain the internal architecture of 8085.

Digital Logic Design Exercises. Assignment 1

KINGS COLLEGE OF ENGINEERING DEPARTMENT OF ELECTRICAL AND ELECTRONICS ENGINEERING QUESTION BANK NAME OF THE SUBJECT: EE 2255 DIGITAL LOGIC CIRCUITS

Combinational and sequential circuits (learned in Chapters 1 and 2) can be used to create simple digital systems.

Logic design Ibn Al Haitham collage /Computer science Eng. Sameer

Final Exam Solution Sunday, December 15, 10:05-12:05 PM

Topic #6. Processor Design

KING FAHD UNIVERSITY OF PETROLEUM & MINERALS COMPUTER ENGINEERING DEPARTMENT

Memory Supplement for Section 3.6 of the textbook

CS 261 Fall Mike Lam, Professor. Combinational Circuits

Dec Hex Bin ORG ; ZERO. Introduction To Computing

Philadelphia University Student Name: Student Number:

Chapter 2. Boolean Expressions:

R10. II B. Tech I Semester, Supplementary Examinations, May

Computer Organization (Autonomous)

Code No: 07A3EC03 Set No. 1

Computer Architecture

3. The high voltage level of a digital signal in positive logic is : a) 1 b) 0 c) either 1 or 0

Scheme G. Sample Test Paper-I

Concept of Memory. The memory of computer is broadly categories into two categories:

DLD VIDYA SAGAR P. potharajuvidyasagar.wordpress.com. Vignana Bharathi Institute of Technology UNIT 3 DLD P VIDYA SAGAR

B.Tech II Year I Semester (R13) Regular Examinations December 2014 DIGITAL LOGIC DESIGN

Von Neumann Architecture

MGU-BCA-205- Second Sem- Core VI- Fundamentals of Digital Systems- MCQ s. 2. Why the decimal number system is also called as positional number system?

REGISTER TRANSFER AND MICROOPERATIONS

1. Mark the correct statement(s)

R a) Simplify the logic functions from binary to seven segment display code converter (8M) b) Simplify the following using Tabular method

Chap-2 Boolean Algebra

Storage Elements & Sequential Circuits

Computer Systems. Binary Representation. Binary Representation. Logical Computation: Boolean Algebra

COA. Prepared By: Dhaval R. Patel Page 1. Q.1 Define MBR.

CS/ECE 252: INTRODUCTION TO COMPUTER ENGINEERING UNIVERSITY OF WISCONSIN MADISON

CS429: Computer Organization and Architecture

Philadelphia University Department of Computer Science. By Dareen Hamoudeh

1. INTRODUCTION TO MICROPROCESSOR AND MICROCOMPUTER ARCHITECTURE:

COMBINATIONAL LOGIC CIRCUITS

DE Solution Set QP Code : 00904

Final Examination (Open Katz, asynchronous & test notes only, Calculators OK, 3 hours)

ECE 331: N0. Professor Andrew Mason Michigan State University. Opening Remarks

ECE 341 Midterm Exam

Microcomputers. Outline. Number Systems and Digital Logic Review

Overview. Memory Classification Read-Only Memory (ROM) Random Access Memory (RAM) Functional Behavior of RAM. Implementing Static RAM

Basic Processing Unit: Some Fundamental Concepts, Execution of a. Complete Instruction, Multiple Bus Organization, Hard-wired Control,

Module 5 - CPU Design

EECS150 Homework 2 Solutions Fall ) CLD2 problem 2.2. Page 1 of 15


Computer Architecture: Part III. First Semester 2013 Department of Computer Science Faculty of Science Chiang Mai University

Chapter 4. Combinational Logic

UNIT- V COMBINATIONAL LOGIC DESIGN

Memory General R0 Registers R1 R2. Input Register 1. Input Register 2. Program Counter. Instruction Register

Digital Design Using Digilent FPGA Boards -- Verilog / Active-HDL Edition

APPENDIX A SHORT QUESTIONS AND ANSWERS

2. (a) Compare the characteristics of a floppy disk and a hard disk. (b) Discuss in detail memory interleaving. [8+7]

Department of Electrical Engineering McGill University ECSE 221 Introduction to Computer Engineering Assignment 2 Combinational Logic

FPGA. Logic Block. Plessey FPGA: basic building block here is 2-input NAND gate which is connected to each other to implement desired function.

Transcription:

Reference Sheet for C112 Hardware 1 Boolean Algebra, Gates and Circuits Autumn 2016 Basic Operators Precedence : (strongest),, + (weakest). AND A B R 0 0 0 0 1 0 1 0 0 1 1 1 OR + A B R 0 0 0 0 1 1 1 0 1 1 1 1 NOT A R 0 1 1 0 Simplification Rules ˆ AND and OR are associative, commutative and distributive. ˆ (A ) = A. ˆ A A = 0 and A + A = 1. ˆ A A = A and A + A = A. ˆ A 0 = 0 and A + 1 = 1. Analysing Circuits Work systematically, building up a formula or truth table in stages. Simplifying Circuits Use De Morgan s: ˆ A 1 = A and A + 0 = A. ˆ (A + B) = A B and (A B) = A + B (De Morgan s). Note that: ˆ Each equation has a dual (swap AND with OR and 0 with 1). ˆ De Morgan s holds for any number of terms. Gates There are 4 possible one-input and 16 possible two-input gates. NAND and NOR are preferred (small and fast). Control and Data Variables E.g. in a multiplexer: 1

2 Combinatorial Circuits Minterms and Maxterms ˆ Minterm: Boolean product term in which for each input, A k, A k appears exactly once. ˆ Maxterm: Boolean sum term... Cannonical Forms or A k 4. Draw the circuit. 5. Minimise to suit production method: (a) Reduce size (e.g. replace OR, AND by NAND, NOR). (b) Improve speed (reduce cycles). ˆ Minterm Cannonical Form: Boolean sum of all minterms that ouput 1. ˆ Maxterm Cannonical Form: Boolean product of all maxterms that output 0. 6. Test the circuit (e.g. systematic testing, formal verificaiton). Karnaugh Maps E.g. 3 Physical Implementation Models of the Transistor Need to take into account a time delay. 1. Procedural model: Remember: ˆ Order (00, 01, 11, 10) is important. ˆ K-maps are cyclic. ˆ We might be able to make a considerable simplification by considering maxterms (0s) instead of minterms. ˆ Don t cares (X) can be 0 or 1 - value depends on whether not they are circled. Combinatorial Circuit Design Process 1. Generate the truth table. 2. Generate the Karnaugh map. (a) G, Dand G, S not connected. (b) If V GS < 0.5V: switch open. (c) If V GS > 1.7V: switch closed. 2. Time Delay: (a) It takes a constant time for the transistor to which states - can lead to spikes. 3. Change is not Instantaneous: (a) Account for capacitance: I = C dv dt. Ideal change is 0-5V, but actually is somewhere close 0.2-3.7V (with 0.5-1.7V considered non-deterministic). 3. Find the minimal Boolean Expression: (a) Read off the K-map. (b) Factor out any common factors. 2

Basic Gate Implementations NOT Fan out The number of inputs to which the output of a gate is connected. ˆ Since 1 R = 1 R 1 + 1 R 2 +... + 1 R n for n resistors in parallel, the load resistance decreases as fan out increases, so output voltage falls. ˆ Slows down circuit since capacitance is summed accross all gates. NAND and NOR 4 Synchronous Digital Systems Feedback Circuit below could: Actual ICs generally use a combination of NMOS and PMOS (Complimentary Metal Oxide Silicon) instead of resistors - lower power consumption and faster switching. Time Dependent Behaviour of Circuits ˆ Oscillate between values of 0 and 1. ˆ Settle at an intermediate value (actually 1.2V). The R-S Flip Flop E.g. consider: Noise Margin By considering all possible states for (RSPQ) and what they lead to in the following time step: 3

Solution: edge triggered circuit: Master-Slave Flip-Flop. Now both gates cannot be open at the same time: ˆ Uncertain about state at start (until set or reset). ˆ SR = 01: Resets memory (Q) to 0. Flip-Flops Different types: ˆ SR = 10: Sets memory (Q) to 1. ˆ SR = 11: Keeps current state. D-Type Latch Consider: Preset and Clear ˆ PRESET sets Q to 1. ˆ CLEAR sets Q to 0. ˆ Behaves normally when PRESET and CLEAR both set to 1. ˆ If latch set to 1, Q becomes D. ˆ If latch set to 0, Q is held. Edge Triggering D-type latch has undesirable behaviour. While latch is 1, any change on D changes Q: 4

Synchronous Digital Systems ˆ Synchronous: Circuit only changes in response to system clock. ˆ Sequential: Goes through sequence of states. General form: 5 Functional Design Shift Registers ˆ Inside a computer data is organised in a parallel form, but communication usually involves serial data. ˆ Registers are an ordered group of flip-flops connected to a single clock. ˆ We can convert paralell and serial data. ˆ The state sequencing logic and output logic are combinatorial circuits. ˆ Outputs depend only on state of circuit. ˆ Next state depends on current state and inputs. Sequential Circuit Design Process 1. Determine the required number of states and assign each output to a state. Adjacent assignments should be given to states if they: (a) Have the same next state for a given input. (b) Are the next states of the same state. (c) Or choose to minimise output logic. 2. Determine the state transitions. Draw a state transition diagram and a state transition table. 3. For each flip-flop input D n, draw a Karnaugh Map and determine a Boolean expression in terms of the flip-flop outputs and circuit inputs. Simplify. 4. Check don t cares. Fix by one of these methods: ˆ Time to load a parallel input depends on length of register. ˆ Requires a seperate (slower) clock to processor clock. Multi-Function Registers Want to be able to shift bits left / right with the same circuitry. (a) Look at K-Maps and try to find a simple modification. (b) Include unused states and redo. 5. Determine Boolean expressions for output from the state assignments, using Karnaugh maps. 6. Draw and optimise the circuit. Remember common terms only need to be committed to hardware once! Here we can use 00 to hold, 01 to shift right, 10 to shift left, 11 to load parallel. 5

Dividing Clocks We can divide clocks by 2 easily: We can stack these, one after the other, to divide by any power of 2. For non-powers of 2, we: ˆ Design to the next highest power of 2. 1. Select source register using multiplexer. ˆ Then use clear when the required count is reached to reset count to 0. 2. Select destination register using demultiplexer. E.g. for 5: 3. Transfer data from source to destination. Multiplexers A 4-to-1 multiplexer: Register Transfer Operations (R dst Rsrc) Extended to 8-to-1 by functional design: 6

Extended to 4-bit by functional design: 5.1 Computer Arithmetic Half Adder S = A B and C = A B: Demultiplexers A 2-to-4 demultiplexer: A B Sum Carry 0 0 0 0 0 1 1 0 1 0 1 0 1 1 0 1 Extended to 3-to-8 by functional design: Full Adder Need to propogate the carry, S = A B C and C out = C (A B) + A B. Comparators A 1-bit comparator: A B C in S C out 0 0 0 0 0 0 0 1 1 0 0 1 0 1 0 0 1 1 0 1 1 0 0 1 0 1 0 1 0 1 1 1 0 0 1 1 1 1 1 1 Ripple Through Carry Adder For n bits: 7

Multiplication a 1 a 0 b 1 b 0 = a 1 b 1 2 2 + a 0 b 1 2 + a 1 b 0 2 + a 0 b 0. Multiplication by 2 is equivalent to a left shift, so for 2 bits: Serial Adder Assumes bits arrive least significant first. Using functional design, for 4 bits: Subtractor Difference = A B P and Borrow = A (B P ) + B P : A B P Difference Borrow 0 0 0 0 0 0 1 0 1 1 1 0 0 1 0 1 1 0 0 0 0 0 1 1 1 0 1 1 0 1 1 0 1 0 0 1 1 1 1 1 Division Subtractor using Two s Complement A B = A + ( B). ˆ Can be done procedurally using shifts and subtracts. ˆ Combinatorial hardware also exists. 8

A simple combinatorial circuit that bundles together arithmetic cir- The ALU cuits: Requires two multiplexers per bit. Assuming the two subtractors and one adder are already in place: Here we have the functions: A - unchanged, B - rotate left, C - arithmetic left shift, D - left shift with carry, E - rotate right, F - logical right shift, G - arithmetic right shify, H - right shift with carry. 6 Processors A Manual Processor Data Path Diagram Here we have the functions: A - constant 0, B - B A, C - A B, D - A + B, E - A B, F - A + B, G - A B, H - constant 1. We can use functional design to extend the ALU to 8 bits: Instruction Format follows: We define the instruction register hold instructions as IR7 IR6 IR5 IR4 IR3 IR2 IR1 IR0 UN F/ALU-SHIFT UN S/R S/C S/A The Shifter We can very easily design an eight function shifter: ˆ S/A selects input to A register. ˆ S/C selects input to Carry in of ALU. ˆ S/R selects input to RES-register. ˆ F/ALU determinse function of ALU/shifter. 000 for A,..., 111 for H. ˆ Bits 3 and 7 are unused. 9

Execution Cycle 1. Load IR register. 2. Load A register. 3. Load B, C registers. 4. Load IR register. 5. Load RES, C registers. Example Sequential Circuit Design For a manual processor: 1. State Assignment Chosen to minimise output logic: Operate This State Q 2 Q 1 Q 0 Next State D 2 D 1 D 0 0 0 000 0 0 0 0 0 1 001 0 0 0 0 0 2 100 0 0 0 0 0 3 010 0 0 0 0 0 4 101 0 0 0 0 0 5 110 0 0 0 0 0 6 011 0 7 111 1 0 000 1 0 0 1 1 1 001 2 1 0 0 1 2 100 3 0 1 0 1 3 010 4 1 0 1 1 4 101 5 1 1 0 1 5 110 1 0 0 1 1 6 011 1 7 111 3. State Sequencing Logic - Karnaugh Maps and Boolean Eqns Q 2 Q 1 Q 0 State Output 000 0 none 001 1 ClkIR 100 2 ClkA 010 3 ClkB, ClkC 101 4 ClkIR 110 5 ClkC, ClkRES 2. State Transition Diagram 4. Checking Don t Cares Operate This State Q 2 Q 1 Q 0 Next State D 2 D 1 D 0 0 6 011 0 0 0 0 0 7 111 0 0 0 0 2. State Transition Table 1 6 011 4 1 0 1 1 7 111 4 1 0 1 So if the OPERATE input is at 0 when the processor is switched on, the system will begin in IDLE state. 10

5. Output Logic - Karnaugh Maps and Boolean Eqns If C is 0, ouput follows D, otherwise is disconnected com- Tri-State Buffer pletely. *. Connecting Output to the System Clock We can use a demultiplexer to make sure only one input has C set to 0. Random Access Memory Normally organised in two dimensions with row and column decoders. We use a NAND gate to connect each output to the system clock. This means the state register changes on the falling edge, avoiding race conditions when the next state is set on the following rising edge. We now have a manual processor! Memory ˆ A D-type flip flop is a one bit memory. ˆ We need to give it an address (binary number). We use a demultiplexer to do this. ˆ Each memory cell enabled when both row and column lines are 1. ˆ Only ever one such cell. ˆ Each cell connected to same read/write line and data line. ˆ Data line connected to outside through a two-way tri state buffer, so unless the chip is enabled, no data can pass in or our. Allows RAM with several chips. Connecting RAM to a Processor ˆ Need Memory Address Register (MAR) to store address. ˆ Memory Data Register (MDR) to store data read from memory / to be written to memory. Buses E.g. address bus, data buses, control bus. ˆ Data-in and data-out are never used at the same time. Convenient to use one (bi-directonal) bus. This requires a tri-state buffer. ˆ Program counter (PC) stores address of next program instruction to be executed. ˆ Instruction register (IR) stores the program instruction executed. 11

ˆ Replace bi-directional data bus with seperate data in and data out buses. Fetch Cycle To retrieve data from memory we go through register transfer steps. E.g. to get the next program instruction and load it into the IR: 1. MAR PC Defining Operations E.g. LOAD, using register transfer language: 2. MDR RAM [MAR], PC PC + 1 3. IR MDR Controller ˆ Sets multiplexers to establish required connection paths. ˆ Gives falling edge signal to clock inputs of registers to be loaded (done by gating system clock - NAND with clock control logic). ˆ Is a synchronous sequential circuit. Dynamic RAM For large RAMs, D-Q flip flops are to big, instead one transistor and capacitor is used for each bit. Value = whether capacitor is charged. ˆ Store is not permanent, ones drift to zero quickly. ˆ Capacitor charge is restored regularly, done by memory controller when the computer not accessing memory. Speeding Up the Processor ˆ Change buses from 8 to 32 bit. ˆ Provide local registers which can be programmed to store partial results. ˆ Design a controller with as small a number of execution cycles as possible. ˆ Remove carry arrangments, doing arithmetic on big integers. Instruction Cycle Transfers Path LOAD Rdst, Addr E1 MAR MDR Via bit mask E2 MDR Memory E3 Rdst MDR No mask Instruction format: 8 bits for the opcode, 4 for Rdest, 20 for address. Designing the Controller ˆ Define a control input based on how many cycles required for each operation. Using 8-to-256 decoder to decode the opcode. Using 3-to-8 decoder for current state. ˆ Sequential design problem to work out next state, uses this control input and previous state. ˆ Output logic: Clocks: NAND gates with system clock. In practice, we can simplify output logic by considering the following cycle. Multiplexers and ALU / Shifter function selection output is trivial. Possible Improvements ˆ Instructions packed on byte boundaries so not to waste fetch cycles. ˆ Additional arithmetic hardware. ˆ Additional multiplexers, e.g. to select input of B independently of A. 12