Software Engineering 2DA4. Slides 8: Multiplexors and More

Similar documents
Chapter 3 Combinational Logic Design

Unit 9. Multiplexers, Decoders, and Programmable Logic Devices. Unit 9 1

Section 3: Combinational Logic Design. Department of Electrical Engineering, University of Waterloo. Combinational Logic

MODULAR CIRCUITS CHAPTER 7

CprE 281: Digital Logic

Multiplexers Decoders ROMs (LUTs) Page 1

Boolean Logic Continued Prof. James L. Frankel Harvard University

ECE 545 Digital System Design with VHDL Lecture 1. Digital Logic Refresher Part A Combinational Logic Building Blocks

ALU A functional unit

Semiconductor Memories

ECE 545 Digital System Design with VHDL Lecture 1A. Digital Logic Refresher Part A Combinational Logic Building Blocks

Logic. Combinational. inputs. outputs. the result. system can

ELCT201: DIGITAL LOGIC DESIGN

512K x 32 Static RAM CY7C1062AV33. Features. Functional Description. Logic Block Diagram. Selection Guide

ENGIN 112 Intro to Electrical and Computer Engineering

Combinational Logic. Mantıksal Tasarım BBM231. section instructor: Ufuk Çelikcan

University of Toronto Faculty of Applied Science and Engineering Edward S. Rogers Sr. Department of Electrical and Computer Engineering

Memory, Latches, & Registers

The Digital Logic Level

COMBINATIONAL LOGIC CIRCUITS. Dr. Mudathir A. Fagiri

Chapter # 4: Programmable and Steering Logic

2009 Spring CS211 Digital Systems & Lab CHAPTER 2: INTRODUCTION TO LOGIC CIRCUITS

I/O 8 I/O 15 A13 A 14 BHE WE CE OE BLE

3 Logic Function Realization with MSI Circuits

256K x 16 Static RAM CY7C1041BN. Features. Functional Description

Logic Design Combinational Circuits. Digital Computer Design

Spiral 2-4. Function synthesis with: Muxes (Shannon's Theorem) Memories

CSE 140 Lecture 11 Standard Combinational Modules. CK Cheng and Diba Mirza CSE Dept. UC San Diego

Digital Integrated Circuits A Design Perspective

Unit 3 Session - 9 Data-Processing Circuits

CMOS Digital Integrated Circuits Lec 13 Semiconductor Memories

CHAPTER1: Digital Logic Circuits Combination Circuits

Floating Point Representation and Digital Logic. Lecture 11 CS301

Topics. Dynamic CMOS Sequential Design Memory and Control. John A. Chandy Dept. of Electrical and Computer Engineering University of Connecticut

Chapter 4. Combinational: Circuits with logic gates whose outputs depend on the present combination of the inputs. elements. Dr.

Combinational Logic Design Combinational Functions and Circuits

CMPE12 - Notes chapter 1. Digital Logic. (Textbook Chapter 3)

CS470: Computer Architecture. AMD Quad Core

MM74C912 6-Digit BCD Display Controller/Driver

Introduction to Digital Logic Missouri S&T University CPE 2210 PLDs

Reg. No. Question Paper Code : B.E./B.Tech. DEGREE EXAMINATION, NOVEMBER/DECEMBER Second Semester. Computer Science and Engineering


ECE 2300 Digital Logic & Computer Organization

COMBINATIONAL LOGIC FUNCTIONS

DIGITAL LOGIC CIRCUITS

MAHARASHTRA STATE BOARD OF TECHNICAL EDUCATION (Autonomous) (ISO/IEC Certified)

on candidate s understanding. 7) For programming language papers, credit may be given to any other program based on equivalent concept.

CprE 281: Digital Logic

Function of Combinational Logic ENT263

Appendix B. Review of Digital Logic. Baback Izadi Division of Engineering Programs

IMPERIAL COLLEGE OF SCIENCE, TECHNOLOGY AND MEDICINE UNIVERSITY OF LONDON DEPARTMENT OF ELECTRICAL AND ELECTRONIC ENGINEERING EXAMINATIONS 2005

HN58C65 Series word 8-bit Electrically Erasable and Programmable CMOS ROM

Semiconductor Memory Classification

Ch 4. Combinational Logic Technologies. IV - Combinational Logic Technologies Contemporary Logic Design 1

LOGIC CIRCUITS. Basic Experiment and Design of Electronics

Unit 9. Multiplexers, Decoders, and Programmable Logic Devices

16-Mbit (1M x 16) Static RAM

Vidyalankar S.E. Sem. III [EXTC] Digital Electronics Prelim Question Paper Solution ABCD ABCD ABCD ABCD ABCD ABCD ABCD ABCD = B

Boolean Algebra and Digital Logic 2009, University of Colombo School of Computing

HN58C66 Series word 8-bit CMOS Electrically Erasable and Programmable CMOS ROM. ADE F (Z) Rev. 6.0 Apr. 12, Description.

HN58C256 Series word 8-bit Electrically Erasable and Programmable CMOS ROM

3.3 V 256 K 16 CMOS SRAM

ESE 570: Digital Integrated Circuits and VLSI Fundamentals

Design of Sequential Circuits

MM74C922 MM74C Key Encoder 20-Key Encoder

S.Y. Diploma : Sem. III [DE/ED/EI/EJ/EN/ET/EV/EX/IC/IE/IS/IU/MU] Principles of Digital Techniques

For smaller NRE cost For faster time to market For smaller high-volume manufacturing cost For higher performance

Overview. Multiplexor. cs281: Introduction to Computer Systems Lab02 Basic Combinational Circuits: The Mux and the Adder

Digital Integrated Circuits Lecture 14: CAMs, ROMs, and PLAs

1-Mbit (128K x 8) Static RAM

SUMMER 18 EXAMINATION Subject Name: Principles of Digital Techniques Model Answer Subject Code:

DIGITAL LOGIC CIRCUITS

Sample Test Paper - I

DESIGN AND IMPLEMENTATION OF ENCODERS AND DECODERS. To design and implement encoders and decoders using logic gates.

DS K x 8 Static RAM FEATURES PIN ASSIGNMENT PIN DESCRIPTION

Magnetic core memory (1951) cm 2 ( bit)

5.0 V 256 K 16 CMOS SRAM

LOGIC CIRCUITS. Basic Experiment and Design of Electronics. Ho Kyung Kim, Ph.D.

Introduction to Computer Engineering. CS/ECE 252, Fall 2012 Prof. Guri Sohi Computer Sciences Department University of Wisconsin Madison

Digital Logic. CS211 Computer Architecture. l Topics. l Transistors (Design & Types) l Logic Gates. l Combinational Circuits.

Systems I: Computer Organization and Architecture

Chapter 2 Combinational Logic Circuits

CSC9R6 Computer Design. Practical Digital Logic

2-Mbit (128K x 16)Static RAM

32K x 8 EEPROM - 5 Volt, Byte Alterable

EECS 270 Midterm 2 Exam Answer Key Winter 2017

HN27C1024HG/HCC Series

COSC3330 Computer Architecture Lecture 2. Combinational Logic

April 2004 AS7C3256A

GMU, ECE 680 Physical VLSI Design 1

Contents. Chapter 3 Combinational Circuits Page 1 of 36

Computer organization

Digital Logic: Boolean Algebra and Gates. Textbook Chapter 3

Slides for Lecture 19

5 V 64K X 16 CMOS SRAM

University of Guelph School of Engineering ENG 2410 Digital Design Fall There are 7 questions, answer all questions.

Looking at a two binary digit sum shows what we need to extend addition to multiple binary digits.

MM74C912 6-Digit BCD Display Controller Driver MM74C917 6-Digit Hex Display Controller Driver

CSE370 HW3 Solutions (Winter 2010)

Digital Logic Design ENEE x. Lecture 14

Transcription:

Software Engineering 2DA4 Slides 8: Multiplexors and More Dr. Ryan Leduc Department of Computing and Software McMaster University Material based on S. Brown and Z. Vranesic, Fundamentals of Digital Logic with Verilog Design, 3rd Ed. c 1999-2017 R.J. Leduc, M. Lawford 1

Multiplexers A two input multiplexer (mux) can be built using either transmission gates or sum-of-products form. T-gate implementation uses fewer transistors. c 1999-2017 R.J. Leduc, M. Lawford 2

Multiplexers - 4 Inputs For 4 inputs, need 2 select lines s 0,s 1. Can build with three 2-input muxes or using S-of-P form. If using transmission gates, then using the three muxes is preferred as requires less transistors. c 1999-2017 R.J. Leduc, M. Lawford 3

Multiplexers - 16 Inputs In general, an n-input mux has 1 output and log 2 (n) select lines. Below we see a 16 input mux. c 1999-2017 R.J. Leduc, M. Lawford 4

Multiplexers Synthesizing Logic Functions Consider Figure below. Have function f with inputs w 1 and w 2, thus 2 2 = 4 possible input combinations. Can implement f using a 4-to-1 mux. Set s 1 = w 1 and s 0 = w 2. Then set the four inputs of the mux to match the values of the truth table of f. ie. the first input of the mux is set to the value of f for w 1 w 2 = 00 This is approach used for FPGA lookup tables (LUT). c 1999-2017 R.J. Leduc, M. Lawford 5

Multiplexers Synthesizing Logic Functions - II Can implement using only a 2-to-1 mux. Consider truth table below that has been re-arranged. We see that f = w 2 when w 1 = 0 and that f = w 2 when w 1 = 1. We can thus use w 1 as our select input as in Figure below. c 1999-2017 R.J. Leduc, M. Lawford 6

Shannon s Expansion Theorem Theorem provides the formal basis for circuit decomposition using muxes. Theorem Any Boolean function f(x 1,x 2,...,x n ) can be written as (is logically equivalent to): x 1 f(0,x 2,...,x n )+x 1 f(1,x 2,...,x n ) i.e. f(x 1,x 2,...,x n ) = x 1 f(0,x 2,...,x n ) +x 1 f(1,x 2,...,x n ) Here f(0,x 2,...,x n ) denotes f with x 1 set to 0. This is sometimes abreviated as f x1 =0 or f x1. So f = x 1 f x1 =0 +x 1 f x1 =1 = x 1 f x1 +x 1 f x1 c 1999-2017 R.J. Leduc, M. Lawford 7

Shannon s Expansion Theorem - II More generally, for any i {1,...n}: f(x 1,...,x n ) = x i f(x 1,...,x i 1,0,x i+1,...x n ) +x i f(x 1,...,x i 1,1,x i+1,...,x n ) = x i f xi +x i f xi c 1999-2017 R.J. Leduc, M. Lawford 8

Shannon s Expansion Theorem Example Consider f(w 1,w 2,w 3 ), a 3-input majority function. The function is true iff any two inputs are both true. f(w 1,w 2,w 3 ) = w 1 w 2 +w 1 w 3 +w 2 w 3 We decide to decompose in terms of input w 1. Since we are using one variable, we can only choose between two inputs, so we will use a 2-to 1 mux to implement. f = w 1 f w1 +w 1 f w1 = w 1 (0 w 2 +0 w 3 +w 2 w 3 )+w 1 (1 w 2 +1 w 3 +w 2 w 3 ) = w 1 (w 2 w 3 )+w 1 (w 2 +w 3 +w 2 w 3 ) 5a, 6a, 6b = w 1 (w 2 w 3 )+w 1 (w 2 +w 3 ) 13a c 1999-2017 R.J. Leduc, M. Lawford 9

Shannon s Expansion Theorem Example - II Using: f = w 1 (w 2 w 3 )+w 1 (w 2 +w 3 ) We now take w 1 as the select input of our 2-to-1 mux, with w 2 w 3 connected to first input, and w 2 +w 3 connected to the second input. Which variable we choose to decompose in can result in different costs. See eg. 4.4 of text. c 1999-2017 R.J. Leduc, M. Lawford 10

Shannon s Expansion Theorem Example - III If we wanted to implement f(w 1,w 2,w 3 ) using a 4-to-1 mux, we d have to decompose using two variables. If we take the results from decomposing using w 1 as our starting place, we could additionally decompose using a second variable, say w 2. f = w 1 (w 2 w 3 )+w 1 (w 2 +w 3 ) = w 2 f w2 +w 2 f w2 = w 2 (w 1 (0 w 3 )+w 1 (0+w 3 )) +w 2 (w 1 (1 w 3 )+w 1 (1+w 3 )) = w 2 (w 1 (0)+w 1 (w 3 ))+w 2 (w 1 (w 3 )+w 1 (1))) 5a, 5b, 6a, 6b = w 2 w 1 (0)+w 2 w 1 (w 3 )+w 2 w 1 (w 3 )+w 2 w 1 (1) 12a = w 2 w 1 f(0,0,w 3 )+w 2 w 1 f(1,0,w 3 ) +w 2 w 1 f(0,1,w 3 )+w 2 w 1 f(1,1,w 3 ) c 1999-2017 R.J. Leduc, M. Lawford 11

Shannon s Expansion Theorem Example - IV Finally, if we use all three inputs as selections, we can implement f using an 8-to-1 mux by setting the 8 inputs of the mux to match the values from truth table. c 1999-2017 R.J. Leduc, M. Lawford 12

Decoders Decoders are used to decode information. Decoders are commonly used in computer memories to decode memory accesses. In general, it has n inputs, 2 n outputs, and an enable input. Each input combination (code) is mapped to a unique output. Standard mapping is to use minterms. ie. minterm 0 maps to output 0. c 1999-2017 R.J. Leduc, M. Lawford 13

2-to-4 Decoder c 1999-2017 R.J. Leduc, M. Lawford 14

3-to-8 Decoder Can implement a 3-to-8 decoder using two 2-to-4 decoders. c 1999-2017 R.J. Leduc, M. Lawford 15

4-to-16 Decoder Higher order decoders are commonly built using decoder trees. A 4-to-16 decoder example is shown below. c 1999-2017 R.J. Leduc, M. Lawford 16

Read Only Memory (ROM) The two main type of memory devices in a computer are ROM (read only memory) and RAM (random access memory). ROM is memory that you cannot write to under normal operation. Some ROMs can be configured or programmed by the user (PROMs). If they can be erased, using ultraviolet light or a high voltage, and reprogrammed, they are called EPROMs or EEPROMs (Electrically Erasable Programmable ROM), respectively. ROMs are non-volatile - their contents remain the same when the system is powered off and turned back on. c 1999-2017 R.J. Leduc, M. Lawford 17

Structure of ROMs A ROM has m inputs used to select from 2 m rows of data. A decoder is used to do the mapping. The m inputs, a 0,a 1,...,a m 1, are called address lines. Each row of data has n columns, and thus the ROM has n outputs, d 0,d 1,...,d n 1, called data lines. c 1999-2017 R.J. Leduc, M. Lawford 18

Structure of ROMs - II Address lines select which row of data will appear at the n data lines. Output enable for the ROM is the Read line. When Read = 1, then data driven to the output, otherwise output is high impedance. To access data, apply desired address to address lines, and then set Read = 1. c 1999-2017 R.J. Leduc, M. Lawford 19

ROM Example Below, we have four 2764 EPROMs (13 adress lines and 8 data lines) mapped onto a 14 bit address bus and a 16 bit data bus. The VPP and PGM inputs are used to program the EPROM. Address lines are A 0,A 1,...,A 12 and data lines are O 0,...,O 7. Input CS is an additional selection line used (ie. the chip does nothing unless CS = 0). The line OE drives the data onto the bus (ie ouput enable). c 1999-2017 R.J. Leduc, M. Lawford 20

ROM Example - II Each EPROM has 2 13 eight bit memory locations. To create 16 bit memory locations, two EPROMS are paired (ie. U3 and U2). The outputs of the first chip (ie. U2) are connected to D 7...D 0, and the outputs of the second (ie. U3) to D 15...D 8. Both are attached to address lines A 12...A 0. To make use of address line A 13 of the CPU and to double the memory, A 13 is connected to CS input of the pair U1 and U0, and A 13 to CS input of the pair U2 and U3. When A 13 = 0, U1 and U0 are selected, otherwise U2 and U3. c 1999-2017 R.J. Leduc, M. Lawford 21

ROM Example - III c 1999-2017 R.J. Leduc, M. Lawford 22

Random Access Memory (RAM) Random Access Memory (RAM) is similar in structure to ROM, except it contains additional logic to store data. Like a ROM, it has address lines and data lines, but now the data lines can be either inputs or outputs. c 1999-2017 R.J. Leduc, M. Lawford 23

Random Access Memory (RAM) - II The RAM has an additional control input called Write. When Write = 1, then the data on d 0...d n 1 is stored in the row indicated by the address lines. As inputs Read and Write should never be active at the same time, a RAM usually has a single input labelled Read/Write. c 1999-2017 R.J. Leduc, M. Lawford 24

RAM Data Sheet 1 - a The next slide contains first page of a RAM data sheet. The chip has eight data lines (I/O 0 - I/O 7 ), and 11 address lines (A 0 - A 10 ). Chip can store 2 11 = 2048 bytes of data. For timing purposes, we will examine the CY6116A-35 version which has a a maximum access time of 35ns. Chip has an CE signal that enables/disables the chip. Chip has an WE signal used while writing to RAM. Chip has an OE signal used while reading from RAM. When CE = H or WE = L, the chip s data outputs are high impedance. c 1999-2017 R.J. Leduc, M. Lawford 25

RAM Data Sheet 1 - b c 1999-2017 R.J. Leduc, M. Lawford 26

RAM Data Sheet 2 Sheet shows operating limits for RAM. We are focussing on the -35 version. c 1999-2017 R.J. Leduc, M. Lawford 27

RAM Data Sheet 3 Sheet shows timing information needed for waveforms on next page. Parameter t rc = 35ns specifies that when we do a read cycle, we must wait a minimum of 35ns before we can use chip again. Parameter t wc = 25ns specifies that when we do a write cycle, we must wait a minimum of 25ns before we can use chip again. c 1999-2017 R.J. Leduc, M. Lawford 28

RAM Data Sheet 4 - Read Cycle The next two data sheets contain waveforms for read and write cycles for the RAM. A read cycle means an external device wants data from the RAM. To do a read cycle, we need CE = L, OE = L and WE = H. During read cycle, contents of RAM location specified by address lines show up at data I/O pins. Consider read cycle No. 2, where address lines are assumed to be valid before or at same time that CE goes low. Parameter t DOE specifies the maximum time you must wait from when CE goes low till data is valid at I/O pins. Parameter t HZOE specifies the maximum time you must wait from when OE goes high till I/O pins go high impedance. Parameter t RC specifies the minimum length that CE must stay low and the adress lines must stay valid. c 1999-2017 R.J. Leduc, M. Lawford 29

RAM Data Sheet 4,5 - Write Cycle A write cycle means an external device wants to store data in the RAM. Write cycle occurs when CE is low and WE is low. Data at pins I/O 0 - I/O 7 is written to location specified by address pins. During write, when either CE or WE goes high, write cycle ends. Parameter t SD specifies setup time for data relative to end of write cycle. Data must stay valid for this time frame. Parameter t HD specifies hold time for data relative to end of write cycle. Data must stay valid for this time frame. Parameter t HZWE specifies maximum time from when WE going low to when RAM data outputs go high impedance. Parameter t WC specifies the minimum length that the address lines must stay valid. c 1999-2017 R.J. Leduc, M. Lawford 30

RAM Data Sheet 4 - b c 1999-2017 R.J. Leduc, M. Lawford 31

RAM Data Sheet 5 - b c 1999-2017 R.J. Leduc, M. Lawford 32

Encoders An encoder is the opposite of a decoder. For a binary encoder, you have 2 n inputs into n outputs. Each input maps to one of the 2 n possible output combinations represented by the n outputs. c 1999-2017 R.J. Leduc, M. Lawford 33

Priority Encoders Consider a priority encoder with 3 inputs x 3 x 2 x 1 and 2 outputs f 1 f 0. It indicates the highest priority input that is asserted, and masks the others. If x 3 = 1, f 1 f 0 = 11 else if x 2 = 1, f 1 f 0 = 10 else if x 1 = 1, f 1 f 0 = 01 else f 1 f 0 = 00 x 3 x 2 x 1 f 1 f 0 0 0 0 0 0 0 0 1 0 1 0 1 x 1 0 1 x x 1 1 x 3 x 2 x 1 f 1 f 0 0 0 0 0 0 0 0 1 0 1 0 1 0 1 0 0 1 1 1 0 1 0 0 1 1 1 0 1 1 1 1 1 0 1 1 1 1 1 1 1 c 1999-2017 R.J. Leduc, M. Lawford 34