CMSC 313 Lecture 15 Good-bye Assembly Language Programming Overview of second half on Digital Logic DigSim Demo

Similar documents
CMSC 313 Lecture 16 Announcement: no office hours today. Good-bye Assembly Language Programming Overview of second half on Digital Logic DigSim Demo

Appendix A: Digital Logic. Principles of Computer Architecture. Principles of Computer Architecture by M. Murdocca and V. Heuring

CMSC 313 Lecture 16 Postulates & Theorems of Boolean Algebra Semiconductors CMOS Logic Gates

Appendix A: Digital Logic. Principles of Computer Architecture. Principles of Computer Architecture by M. Murdocca and V. Heuring

Appendix A: Digital Logic. CPSC 352- Computer Organization

CMSC 313 Lecture 19 Homework 4 Questions Combinational Logic Components Programmable Logic Arrays Introduction to Circuit Simplification

CMSC 313 Lecture 19 Combinational Logic Components Programmable Logic Arrays Karnaugh Maps

CMSC 313 Lecture 17. Focus Groups. Announcement: in-class lab Thu 10/30 Homework 3 Questions Circuits for Addition Midterm Exam returned

CMSC 313 Lecture 18 Midterm Exam returned Assign Homework 3 Circuits for Addition Digital Logic Components Programmable Logic Arrays

Why digital? Overview. Number Systems. Binary to Decimal conversion

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

XI STANDARD [ COMPUTER SCIENCE ] 5 MARKS STUDY MATERIAL.

EE40 Lec 15. Logic Synthesis and Sequential Logic Circuits

Computer organization

CMSC 313 Lecture 18 Midterm Exam returned Assign Homework 3 Circuits for Addition Digital Logic Components Programmable Logic Arrays

SRC Language Conventions. Class 6: Intro to SRC Simulator Register Transfers and Logic Circuits. SRC Simulator Demo. cond_br.asm.

Principles of Computer Architecture. Appendix B: Reduction of Digital Logic. Chapter Contents

EECS150 - Digital Design Lecture 19 - Combinational Logic Circuits : A Deep Dive

COSC3330 Computer Architecture Lecture 2. Combinational Logic

Chapter 5. Digital systems. 5.1 Boolean algebra Negation, conjunction and disjunction

CS 226: Digital Logic Design

UNIT 8A Computer Circuitry: Layers of Abstraction. Boolean Logic & Truth Tables

COSC 243. Introduction to Logic And Combinatorial Logic. Lecture 4 - Introduction to Logic and Combinatorial Logic. COSC 243 (Computer Architecture)

Outline. EECS150 - Digital Design Lecture 4 - Boolean Algebra I (Representations of Combinational Logic Circuits) Combinational Logic (CL) Defined

Fundamentals of Digital Design

Digital Logic: Boolean Algebra and Gates. Textbook Chapter 3

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

Electronics. Overview. Introducction to Synthetic Biology

EEE130 Digital Electronics I Lecture #4

EECS150 - Digital Design Lecture 4 - Boolean Algebra I (Representations of Combinational Logic Circuits)

for Digital Systems Simplification of logic functions Tajana Simunic Rosing Sources: TSR, Katz, Boriello & Vahid

Digital Circuits. 1. Inputs & Outputs are quantized at two levels. 2. Binary arithmetic, only digits are 0 & 1. Position indicates power of 2.

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

ENGG 1203 Tutorial. Solution (b) Solution (a) Simplification using K-map. Combinational Logic (II) and Sequential Logic (I) 8 Feb Learning Objectives

Possible logic functions of two variables

Chapter 7 Logic Circuits

CPE100: Digital Logic Design I

Philadelphia University Student Name: Student Number:

COMP2611: Computer Organization. Introduction to Digital Logic

Show that the dual of the exclusive-or is equal to its compliment. 7

Chapter 2: Switching Algebra and Logic Circuits

CS61C : Machine Structures

Digital Design 2. Logic Gates and Boolean Algebra

Lecture A: Logic Design and Gates

CPE100: Digital Logic Design I

CS61C : Machine Structures

Logic Design Combinational Circuits. Digital Computer Design

Digital Fundamentals

Lecture 7: Logic design. Combinational logic circuits

CS61c: Representations of Combinational Logic Circuits

Intro To Digital Logic

CSE140: Components and Design Techniques for Digital Systems. Logic minimization algorithm summary. Instructor: Mohsen Imani UC San Diego

CMSC 313 Lecture 17 Postulates & Theorems of Boolean Algebra Semiconductors CMOS Logic Gates

Combinational logic. Possible logic functions of two variables. Minimal set of functions. Cost of different logic functions.

Lecture 9: Digital Electronics

Logic. Basic Logic Functions. Switches in series (AND) Truth Tables. Switches in Parallel (OR) Alternative view for OR

Philadelphia University Student Name: Student Number:

MC9211 Computer Organization

Working with combinational logic

Combinational Logic (mostly review!)

Name. ECE-200 Intelligent Systems

Unit 8A Computer Organization. Boolean Logic and Gates

Cs302 Quiz for MID TERM Exam Solved

A crash course in Digital Logic

Chapter 2 Combinational Logic Circuits

CHAPTER1: Digital Logic Circuits Combination Circuits

Outline. policies for the first part. with some potential answers... MCS 260 Lecture 10.0 Introduction to Computer Science Jan Verschelde, 9 July 2014

Logic Gates and Boolean Algebra

ENGR 303 Introduction to Logic Design Lecture 3. Dr. Chuck Brown Engineering and Computer Information Science Folsom Lake College

Week-I. Combinational Logic & Circuits

Logic design? Transistor as a switch. Layered design approach. CS/COE1541: Introduction to Computer Architecture. Logic Design Review.

ECE 2300 Digital Logic & Computer Organization

Lecture 1. Notes. Notes. Notes. Introduction. Introduction digital logic February Bern University of Applied Sciences

Lecture 22 Chapters 3 Logic Circuits Part 1

CprE 281: Digital Logic

Learning Objectives. Boolean Algebra. In this chapter you will learn about:

Simplify the following Boolean expressions and minimize the number of literals:

CMSC 313 Lecture 25 Registers Memory Organization DRAM

Chapter 2. Review of Digital Systems Design

L2: Combinational Logic Design (Construction and Boolean Algebra)

Computer Science 324 Computer Architecture Mount Holyoke College Fall Topic Notes: Digital Logic

211: Computer Architecture Summer 2016

UNIVERSITI TENAGA NASIONAL. College of Information Technology

Ch 2. Combinational Logic. II - Combinational Logic Contemporary Logic Design 1

Propositional Logic. Logical Expressions. Logic Minimization. CNF and DNF. Algebraic Laws for Logical Expressions CSC 173

Floating Point Representation and Digital Logic. Lecture 11 CS301

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

Computer Organization: Boolean Logic

L2: Combinational Logic Design (Construction and Boolean Algebra)

Chapter 2 Combinational Logic Circuits

Review. EECS Components and Design Techniques for Digital Systems. Lec 06 Minimizing Boolean Logic 9/ Review: Canonical Forms

Additional Gates COE 202. Digital Logic Design. Dr. Muhamed Mudawar King Fahd University of Petroleum and Minerals

CSE 20 DISCRETE MATH. Fall

Latches. October 13, 2003 Latches 1

Digital Electronics. Delay Max. FF Rate Power/Gate High Low (ns) (MHz) (mw) (V) (V) Standard TTL (7400)

The Karnaugh Map COE 202. Digital Logic Design. Dr. Muhamed Mudawar King Fahd University of Petroleum and Minerals

Philadelphia University Faculty of Engineering

Computer Science. 20. Combinational Circuits. Computer Science COMPUTER SCIENCE. Section

Synchronous Sequential Circuit Design. Digital Computer Design

ELCT201: DIGITAL LOGIC DESIGN

Transcription:

CMSC 33 Lecture 5 Good-bye ssembly Language Programming Overview of second half on Digital Logic DigSim Demo UMC, CMSC33, Richard Chang <chang@umbc.edu>

Good-bye ssembly Language What a pain! Understand pointers better Execution environment of Unix processes the stack virtual memory Linking & loading UMC, CMSC33, Richard Chang <chang@umbc.edu>

-3 ppendix : Digital Logic Some Definitions Combinational logic: a digital logic circuit in which logical decisions are made based only on combinations of the inputs. e.g. an adder. Sequential logic: a circuit in which decisions are made based on combinations of the current inputs as well as the past history of inputs. e.g. a memory unit. Finite state machine: a circuit which has an internal state, and whose outputs are functions of both current inputs and its internal state. e.g. a vending machine controller. Principles of Computer rchitecture by M. Murdocca and V. Heuring 999 M. Murdocca and V. Heuring

-4 ppendix : Digital Logic The Combinational Logic Unit Translates a set of inputs into a set of outputs according to one or more mapping functions. Inputs and outputs for a CLU normally have two distinct (binary) values: high and low, and, and, or 5 V and V for example. The outputs of a CLU are strictly functions of the inputs, and the outputs are updated immediately after the inputs change. set of inputs i i n are presented to the CLU, which produces a set of outputs according to mapping functions f f m. i i i n... Combinational logic unit... f (i, i ) f (i, i 3, i 4 ) f m (i 9, i n ) Principles of Computer rchitecture by M. Murdocca and V. Heuring 999 M. Murdocca and V. Heuring

3-6 Ripple Carry dder Chapter 3: rithmetic Two binary numbers and are added from right to left, creating a sum and a carry at the outputs of each full adder for each bit position. b 3 a 3 c 3 b 2 a 2 c 2 b a c b a c Full adder Full adder Full adder Full adder c 4 s 3 s 2 s s Principles of Computer rchitecture by M. Murdocca and V. Heuring 999 M. Murdocca and V. Heuring

-45 ppendix : Digital Logic Classical Model of a Finite State n FSM is composed of a combinational logic unit and delay elements (called flip-flops) in a feedback path, which maintains state information. Inputs Machine i o i k...... Combinational logic unit Q D... Q n D n... s Synchronization n signal Delay elements (one per state bit) s... f o f m Outputs State bits Principles of Computer rchitecture by M. Murdocca and V. Heuring 999 M. Murdocca and V. Heuring

-7 ppendix : Digital Logic Vending Machine State Transition Q/ dime is inserted Diagram / = Dispense/Do not dispense merchandise N/ D/ / = Return/Do not return a nickel in change / = Return/Do not return a dime in change N/ D Q/ D/ 5 5 Q/ Q/ D/ Principles of Computer rchitecture by M. Murdocca and V. Heuring D/ N/ C N/ N = Nickel D = Dime Q = Quarter 999 M. Murdocca and V. Heuring

CMSC 33, Computer Organization & ssembly Language Programming, Section Fall 23 Course Syllabus We will follow two textbooks: Principles of Computer rchitecture, by Murdocca and Heuring, and Linux ssembly Language Programming, by Neveln. The following schedule outlines the material to be covered during the semester and specifies the corresponding sections in each textbook. Date Topic M&H Neveln ssign Due Th 8/28 Introduction & Overview.-.8.-.6 Tu 9/2 Data Representation I 2.-2.2, 3.-3.3 2.4-2.7, 3.6-3.8 hw Th 9/4 Data Representation II Tu 9/9 i386 ssembly Language I 3.-3.3, 4.-4.8 hw2, proj hw Th 9/ i386 ssembly Language II 6.-6.5 Tu 9/6 i386 ssembly Language III proj2 hw2, proj Th 9/8 i386 ssembly Language IV Tu 9/23 Examples proj3 proj2 Th 9/25 Machine Language 5.-5.7 Tu 9/3 Compiling, ssembling & Linking 5.-5.3 Th /2 Subroutines 7.-7.4 Tu /7 The Stack & C Functions proj4 proj3 Th /9 Linux Memory Model 7.7 8.-8.8 Tu /4 Interrupts & System Calls 9.-9.8 proj4 Th /6 Midterm Exam Tu /2 Introduction to Digital Logic.-.2 3.-3.3 Th /23 Transistors & Logic Gates.3-.4 hw3 Tu /28 In-class Lab I Th /3 oolean Functions & Truth Tables.5-.9 hw4 hw3 Tu /4 Circuits for ddition 3.5 Th /6 Circuit Simplification I.-.2 hw5 hw4 Tu / Combinational Logic Components. Th /3 Flip Flops. digsim hw5 Tu /8 In-class Lab II Th /2 Finite State Machines.2-.5 Tu /25 Circuit Simplification II.3 digsim Th /27 Thanksgiving break Tu 2/2 Finite State Machine Design digsim2 Th 2/4 More Finite State Machine Design Tu 2/9 I/O & Memory 7.-7.6, 8.-8.3 digsim2 Tu 2/6 Final Exam :3am-2:3pm

-5 ppendix : Digital Logic Truth Table Developed in 854 by George oole. Further developed by Claude Shannon (ell Labs). Outputs are computed for all possible input combinations (how many input combinations are there?) Consider a room with two light switches. How must they work? GND Inputs Output Hot Light Z Z Switch Switch Principles of Computer rchitecture by M. Murdocca and V. Heuring 999 M. Murdocca and V. Heuring

-6 ppendix : Digital Logic lternate ssignment of Outputs to Switch Settings We can make the assignment of output values to input combinations any way that we want to achieve the desired input-output behavior. Inputs Output Z Principles of Computer rchitecture by M. Murdocca and V. Heuring 999 M. Murdocca and V. Heuring

-7 ppendix : Digital Logic Truth Tables Showing ll Possible Functions of Two inary Variables Inputs Outputs The more frequently used functions have names: ND, XOR, OR, NOR, XOR, and NND. (lways use upper case spelling.) False ND XOR OR Inputs Outputs NOR XNOR + + NND True Principles of Computer rchitecture by M. Murdocca and V. Heuring 999 M. Murdocca and V. Heuring

-8 ppendix : Digital Logic Logic Gates and Their Symbols Logic symbols shown for ND, OR, buffer, and NOT oolean functions. F F Note the use of the inversion bubble. F = F = + (e careful about the nose of the gate when drawing ND vs. OR.) ND F OR F F = F = uffer NOT (Inverter) Principles of Computer rchitecture by M. Murdocca and V. Heuring 999 M. Murdocca and V. Heuring

ppendix : Digital Logic -9 Principles of Computer rchitecture by M. Murdocca and V. Heuring 999 M. Murdocca and V. Heuring Logic Gates and their Symbols (cont ) F NND F NOR F = F = + F Exclusive-OR (XOR) F = F Exclusive-NOR (XNOR) F =.

- ppendix : Digital Logic Variations of Logic Gate Symbols C F = C F = + (a) (b) + + (c) (a) 3 inputs (b) Negated input (c) Complementary outputs Principles of Computer rchitecture by M. Murdocca and V. Heuring 999 M. Murdocca and V. Heuring

-4 ppendix : Digital Logic Tri-State uffers Outputs can be,, or electrically disconnected. C F ø ø C F ø ø C F = C or F = ø C F = C or F = ø Tri-state buffer Tri-state buffer, inverted control Principles of Computer rchitecture by M. Murdocca and V. Heuring 999 M. Murdocca and V. Heuring

-8 ppendix : Digital Logic Sum-of-Products Form: The Majority Function The SOP form for the 3-input majority function is: M = C + C + C + C = m3 + m5 + m6 + m7 = Σ (3, 5, 6, 7). Each of the 2 n terms are called minterms, ranging from to 2 n -. Note relationship between minterm number and boolean value. Minterm Index 2 3 4 5 6 7 C F -side -side balance tips to the left or right depending on whether there are more s or s. Principles of Computer rchitecture by M. Murdocca and V. Heuring 999 M. Murdocca and V. Heuring

-9 ppendix : Digital Logic ND-OR Implementation of Majority C Gate count is 8, gate input count is 9. C C F C C Principles of Computer rchitecture by M. Murdocca and V. Heuring 999 M. Murdocca and V. Heuring

-2 ppendix : Digital Logic Notation Used at Circuit Intersections Connection No connection Connection No connection Principles of Computer rchitecture by M. Murdocca and V. Heuring 999 M. Murdocca and V. Heuring

Sum of Products (a.k.a. disjunctive normal form) OR (i.e., sum) together rows with output ND (i.e., product) of variables represents each row e.g., in row 3 when x = ND x 2 = ND x 3 = or when x x 2 x 3 = MJ3(x, x 2, x 3 ) = x x 2 x 3 +x x 2 x 3 +x x 2 x 3 +x x 2 x 3 = m(3, 5, 6, 7) x x 2 x 3 MJ3 2 3 4 5 6 7

Product of Sums (a.k.a. conjunctive normal form) ND (i.e., product) of rows with output OR (i.e., sum) of variables represents negation of each row e.g., NOT in row 2 when x = OR x 2 = OR x 3 = or when x + x 2 + x 3 = MJ3(x, x 2, x 3 ) = (x +x 2 +x 3 )(x +x 2 +x 3 )(x +x 2 +x 3 )(x +x 2 +x 3 ) = M(,, 2, 4) x x 2 x 3 MJ3 2 3 4 5 6 7 2

-2 ppendix : Digital Logic OR-ND Implementation of Majority C + + C + + C F + + C + + C Principles of Computer rchitecture by M. Murdocca and V. Heuring 999 M. Murdocca and V. Heuring

Equivalences Every oolean function can be written as a truth table Every truth table can be written as a oolean formula (SOP or POS) Every oolean formula can be converted into a combinational circuit Every combinational circuit is a oolean function Later you might learn other equivalencies: finite automata regular expressions computable functions programs 3

Universality Every oolean function can be written as a oolean formula using ND, OR and NOT operators. Every oolean function can be implemented as a combinational circuit using ND, OR and NOT gates. Since ND, OR and NOT gates can be constructed from NND gates, NND gates are universal. 4

-7 ppendix : Digital Logic ll-nnd Implementation of OR NND alone implements all other oolean logic gates. + + Principles of Computer rchitecture by M. Murdocca and V. Heuring 999 M. Murdocca and V. Heuring

-6 ppendix : Digital Logic DeMorgan s Theorem = = + + DeMorgan s theorem: + = + = F = + F = Principles of Computer rchitecture by M. Murdocca and V. Heuring 999 M. Murdocca and V. Heuring

DigSim Java applet/application that simulates digital logic Not for industrial use, good enough for us dvantages: FREE, runs on most platforms Disadvantages: slow, timing issues, saving issues UMC, CMSC33, Richard Chang <chang@umbc.edu>

CMSC 33, Computer Organization & ssembly Language Programming Section Spring 22 DigSim ssignment 3: J-K Flip-Flops Due: Tuesday May 4, 22 Objective The objective of this assignment is to implement a finite state machine using J-K flip-flops. ssignment Consider the following transition diagram (from Contemporary Logic Design, Randy H. Katz, enjamin-cummings Publishing, 994) for a finite state machine with input bit and output bit: / S / / S / S 2 / / / / S 3 / S 4 / / S 5 / Your assignment is to implement this finite state machine using J-K flip flops. ssume that the state assignments are for S, for S, S 2, for S 3, for S 4, and for S 5.. In the truth table on the next page, let, and C be the current states and, and C be the next states stored in the J-K flip flops. (E.g., S 4 is assigned =, = and C=.) We also use D for the bit input. Fill in the rest of the truth table using the excitation table for J-K flip flops. For example, in row 9, flip-flop is currently storing and must store in the next state. To achieve this, we look at the entry of the excitation table and note that the J input to flip-flop (call it J) can be set to anything, but the K input, K, must be set to. 2. Use the Karnaugh maps provided to simplify the oolean formulas for the J and K inputs to each J-K flip flop and for the output value z. 3. Implement the resulting circuit in DigSim.

Transistors & Gates Next time UMC, CMSC33, Richard Chang <chang@umbc.edu>