Systems I Fall 2013 Mid-term exam solutions

Similar documents
United States Naval Academy Electrical and Computer Engineering Department. EC262 Exam 1

Digital Logic Design. Basics Combinational Circuits Sequential Circuits. Pu-Jen Cheng

Boolean Algebra Part 1

1. True or False? A voltage level in the range 0 to 2 volts is interpreted as a binary 1.

CSEE 3827: Fundamentals of Computer Systems. Standard Forms and Simplification with Karnaugh Maps

Understanding Logic Design

Binary Adders: Half Adders and Full Adders

CHAPTER 3 Boolean Algebra and Digital Logic

Counters and Decoders

Karnaugh Maps & Combinational Logic Design. ECE 152A Winter 2012

Gates, Circuits, and Boolean Algebra

Boolean Algebra. Boolean Algebra. Boolean Algebra. Boolean Algebra

2.0 Chapter Overview. 2.1 Boolean Algebra

Take-Home Exercise. z y x. Erik Jonsson School of Engineering and Computer Science. The University of Texas at Dallas

Simplifying Logic Circuits with Karnaugh Maps

Digital Electronics Detailed Outline

Lecture 8: Synchronous Digital Systems

Designing Digital Circuits a modern approach. Jonathan Turner

Unit 3 Boolean Algebra (Continued)

Digital Logic Design Sequential circuits

CSE140: Midterm 1 Solution and Rubric

COMBINATIONAL CIRCUITS

Design Example: Counters. Design Example: Counters. 3-Bit Binary Counter. 3-Bit Binary Counter. Other useful counters:

CSE140: Components and Design Techniques for Digital Systems

3.Basic Gate Combinations

exclusive-or and Binary Adder R eouven Elbaz reouven@uwaterloo.ca Office room: DC3576

SAT Math Facts & Formulas Review Quiz

DEPARTMENT OF INFORMATION TECHNLOGY

EE360: Digital Design I Course Syllabus

A single register, called the accumulator, stores the. operand before the operation, and stores the result. Add y # add y from memory to the acc

Click on the links below to jump directly to the relevant section

Digital Electronics Part I Combinational and Sequential Logic. Dr. I. J. Wassell

Boolean Algebra (cont d) UNIT 3 BOOLEAN ALGEBRA (CONT D) Guidelines for Multiplying Out and Factoring. Objectives. Iris Hui-Ru Jiang Spring 2010

Counters are sequential circuits which "count" through a specific state sequence.

Let s put together a Manual Processor

To design digital counter circuits using JK-Flip-Flop. To implement counter using 74LS193 IC.

Karnaugh Maps. Circuit-wise, this leads to a minimal two-level implementation

Course Requirements & Evaluation Methods

ANALOG & DIGITAL ELECTRONICS

So far we have investigated combinational logic for which the output of the logic devices/circuits depends only on the present state of the inputs.

CH3 Boolean Algebra (cont d)

plc numbers Encoded values; BCD and ASCII Error detection; parity, gray code and checksums

Operations with Algebraic Expressions: Multiplication of Polynomials

1.4. Arithmetic of Algebraic Fractions. Introduction. Prerequisites. Learning Outcomes

FORDHAM UNIVERSITY CISC Dept. of Computer and Info. Science Spring, Lab 2. The Full-Adder

SECTION C [short essay] [Not to exceed 120 words, Answer any SIX questions. Each question carries FOUR marks] 6 x 4=24 marks

CHAPTER 11 LATCHES AND FLIP-FLOPS

Chapter 4 Register Transfer and Microoperations. Section 4.1 Register Transfer Language

Properties of Real Numbers

Digital Design. Assoc. Prof. Dr. Berna Örs Yalçın

BINARY CODED DECIMAL: B.C.D.

5 Combinatorial Components. 5.0 Full adder. Full subtractor

Simplifying Algebraic Fractions

Experiment # 9. Clock generator circuits & Counters. Eng. Waleed Y. Mousa

Digital Controller for Pedestrian Crossing and Traffic Lights

Lecture 5: Gate Logic Logic Optimization

BOOLEAN ALGEBRA & LOGIC GATES

Digital circuits make up all computers and computer systems. The operation of digital circuits is based on

Module 3: Floyd, Digital Fundamental

Operating Manual Ver.1.1

Gray Code Generator and Decoder by Carsten Kristiansen Napier University. November 2004

Combinational Logic Design

Elementary Number Theory and Methods of Proof. CSE 215, Foundations of Computer Science Stony Brook University

Having read this workbook you should be able to: recognise the arrangement of NAND gates used to form an S-R flip-flop.

Logic in Computer Science: Logic Gates

Solve addition and subtraction word problems, and add and subtract within 10, e.g., by using objects or drawings to represent the problem.

FORDHAM UNIVERSITY CISC Dept. of Computer and Info. Science Spring, The Binary Adder

The components. E3: Digital electronics. Goals:

Introduction to Digital Logic with Laboratory Exercises

Chapter 2: Boolean Algebra and Logic Gates. Boolean Algebra

CS311 Lecture: Sequential Circuits

ETEC 2301 Programmable Logic Devices. Chapter 10 Counters. Shawnee State University Department of Industrial and Engineering Technologies

3. Mathematical Induction

Solutions of Linear Equations in One Variable

1 Description of The Simpletron

Flip-Flops, Registers, Counters, and a Simple Processor

Logic Reference Guide

CDA 3200 Digital Systems. Instructor: Dr. Janusz Zalewski Developed by: Dr. Dahai Guo Spring 2012

Geometry Module 4 Unit 2 Practice Exam

Gates & Boolean Algebra. Boolean Operators. Combinational Logic. Introduction

A New Paradigm for Synchronous State Machine Design in Verilog

PROGRAMMABLE LOGIC CONTROLLERS Unit code: A/601/1625 QCF level: 4 Credit value: 15 OUTCOME 3 PART 1

Integer Operations. Overview. Grade 7 Mathematics, Quarter 1, Unit 1.1. Number of Instructional Days: 15 (1 day = 45 minutes) Essential Questions

DIGITAL COUNTERS. Q B Q A = 00 initially. Q B Q A = 01 after the first clock pulse.

Sequences. A sequence is a list of numbers, or a pattern, which obeys a rule.

Lecture 1. Basic Concepts of Set Theory, Functions and Relations

How To Understand The Laws Of Algebra

Two's Complement Adder/Subtractor Lab L03

Mechanics 1: Conservation of Energy and Momentum

Digital Circuit Design

CMOS Binary Full Adder

IV. ALGEBRAIC CONCEPTS

earlier in the semester: The Full adder above adds two bits and the output is at the end. So if we do this eight times, we would have an 8-bit adder.

def: An axiom is a statement that is assumed to be true, or in the case of a mathematical system, is used to specify the system.

Functional Dependencies and Finding a Minimal Cover

INCIDENCE-BETWEENNESS GEOMETRY

Part 1 Expressions, Equations, and Inequalities: Simplifying and Solving

Black Problems - Prime Factorization, Greatest Common Factor and Simplifying Fractions

Online EFFECTIVE AS OF JANUARY 2013

Answer Key for California State Standards: Algebra I

Transcription:

Systems I Fall 203 Mid-term exam solutions. Question: (20 points) Prove that nor is a universal operator. That is, prove that any logic function is equivalent to some expression that uses only the nor operator. You may demonstrate equivalence of nor with other operators using Boolean algebra or (labeled) circuit diagrams. Answer: Since a DNF expression can be formed for any function, and since DNF employs only and, or, and not, we infer that this trio of operations is, together, universal. If we can calculate these three using only nor, then nor is also universal. (a) not: (b) or: (c) and: x = x + x (self disjunction) x + y = x + y (double negation) = (x + y) + (x + y) (self disjunction) xy = xy (double negation) = x + ȳ (DeMorgan s) = (x + x) + (y + y) (self disjunction) Discussion: The most common source of error was inattention to detail. Many people failed to note why it would be useful to show the equivalence to the and/or/not operators. Others either used truth tables or (largely) unlabeled circuit diagrams. The former was explicitly not offered as an option for showing equivalence for this question; the latter was acceptable only because it required a demonstration of at least the critical portions of the relevant algebra.

2. Question: (20 points) Consider the logic function described by the following truth table: A B C D Y 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 (a) Write this function in disjunctive normal form. (b) Simplify this expression by using a Karnaugh map. Answer: (a) Disjunctive Normal Form: Y = Ā CD+ Ā BCD+ ĀB C D+ ĀBC D+ ĀBCD+ A B CD+ A BC D+ A BCD+ D+ CD+ 2

(b) Karnaugh map: CD CD CD CD 0 0 α 0 0 0 δ 0 β γ ε Y = α + β + γ + δ + ɛ = BD + B C D + C + ĀBC + A BC Discussion: The mistakes on this question were typical ones: misremembering the layout and/or ordering of each axis; mis-transcribing the correct values into the map; creating rectangles of invalid sizes. These errors lost a some points, but not the majority. More significant errors involved grossly misshapen maps, the use of algebra instead of Karnaugh maps for simplification, and grander failures to understand that question sought a single, simplified logic expression. 3

3. Question: (30 points) Create a circuit that calculates a < b, where a and b are 4-bit, two s-complement values. This circuit should have a -bit output that is when a < b, and 0 otherwise. Hint: Note that a < 0 a b < 0, implying that subtraction is likely a useful operation here. Extra challenge: If you use subtraction to solve this problem, then you must consider the behavior of your solution when the subtraction yields overflow. Can your circuit provide the correct answer for all values of a and b, even in the presence of overflow? If so, how? If not, why not? Answer: A -bit full adder is a device that accepts 3 inputs (c I, a, and b), and emits 2 outputs (c O and r). Define those outputs as: r = c I a b c O = c I a + c I b + ab The question observes that a < b a b < 0. So, we can perform this comparison by: (a) Negating b. (b) Summing a and b. (c) Examining the sign of the result of that summation, where a negative result implies that the comparison is true, and a non-negative result implies that the comparison is f alse. Consider a 4-bit ripple-carry subtracter, shown below. First, the sign of the result can be determined by y 3, which is the most significant bit and is iff y is a negative value. We must also consider overflow, which can be determined by v = c 3 c 4. Since overflow occurs when the sign of the result is incorrect, we know that, when v = then y 3 is the opposite of what it should be. Thus, to restore the correct sign only when overflow occurs, l = y 3 v, where l now indicates the result of a < b even in the presence of overflow. 4

Discussion: First, there was no good excuse for missing this problem. We developed this exact solution in class. More reasonable errors seemed to be the result of studying the sample exam a bit too carefully without thinking about the underlying semantics of the answer. That is, many people explicitly tested the subtraction s result to determine if it was 0. On the sample exam, where the goal was to calculate a > b, combining the result of a < b with a = b was a useful strategy for which detecting equality (found by a b = 0) was necessary. For the problem of finding a < b, evaluating a = b was at best superfluous, and at worst an erroneous addition to your circuit. Some built a circuit that correctly determined the less-than result in the absence of overflow, which required only to remember how subtraction was performed, as well as the examination of the y 3 output. Others tried to incorporate overflow into their solutions, but did so incorrectly. To that end, I will reiterate for what I hope is the last time: The final carry out (c 4 ) is not itself an indication of overflow. Be sure that you understand why before the final exam. 5

4. Question: Draw a circuit that emits the following repeating 2-bit sequence: 00, 0, 00, 0, 00,... Your circuit should have 2 bits of output, as well as incoming clock and clear inputs. Every 6 cycles of the clock should progress through this sequence, which should wrap around and repeat with the next 6 clock cycles. You may use basic memory devices such as flip-flops (which may be aggregated into registers). Answer: The sequence has a length of 6, so we use a 3 bit register to count from 0 to 5, repeatedly, to keep track of the current position in the sequence. Each position number is then mapped to its corresponding output pattern. In the following truth table, Q is the current position number in the sequence, D is the next position number in the sequence, and Y is the value at that point in the sequence. In other words, Q and D are a standard counting sequence, used internally to track which of the in the 2-bit output values Y in the sequence to show at that moment. D 2 D D 0 Q 2 Q Q 0 Y Y 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 From this truth table, we derive the following logic functions for D (which determines the next state) and for Y (which determines the output): D 2 = Q 2 Q Q 0 D = Q 2 (Q Q 0 ) D 0 = Q 0 Y = (Q 2 Q )Q 0 Y 0 = Q Q 0 Given a 3-bit register driven by a clock input, with a clear input that is permanently disabled (not clearing the register), the sequential logic described above yields the following circuit: Accidentally not shown. 6

Discussion: This question was the trickiest of the bunch. The insight was to notice that, although the sequence had two bits per position, two bits alone could not possibly encoding the current position in the sequence. Some used ad-hoc arrangements of four flip-flops, with two bits used to store the current value in the sequence, and two bits to store the previous value. Taken together, those four bits could correctly determine, with some properly mapped logic, the next state. This approach was slightly inefficient bit largely correct. Some other were just thrown for a loop by the question, and created incomprehensible circuits. I d my best to follow them, but sometimes it was hopeless. The most partial credit was given for any sequential logic circuit that used more than two bits to store the current state, and to separate the contents of the memory elements from the eventual output itself. 7