CSCI 220: Computer Architecture-I Instructor: Pranava K. Jha. BCD Codes

Similar documents
Systems I: Computer Organization and Architecture

Logic Simplification. Boolean Simplification Example. Applying Boolean Identities F = A B C + A B C + A BC + ABC. Karnaugh Maps 2/10/2009 COMP370 1

Total Time = 90 Minutes, Total Marks = 50. Total /50 /10 /18

Lecture 6: Gate Level Minimization Syed M. Mahmud, Ph.D ECE Department Wayne State University

Z = F(X) Combinational circuit. A combinational circuit can be specified either by a truth table. Truth Table

Introduction to Karnaugh Maps

UNIT 4 MINTERM AND MAXTERM EXPANSIONS

Karnaugh Map & Boolean Expression Simplification

Midterm Examination # 1 Wednesday, February 25, Duration of examination: 75 minutes

Karnaugh Maps Objectives

CHAPTER 7. Solutions for Exercises

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

Lecture 6: Manipulation of Algebraic Functions, Boolean Algebra, Karnaugh Maps

Chapter 4: Combinational Logic Solutions to Problems: [1, 5, 9, 12, 19, 23, 30, 33]

CSCI 220: Computer Architecture I Instructor: Pranava K. Jha. Multiplexers

Unit 2 Session - 6 Combinational Logic Circuits

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

Minimization techniques

Cs302 Quiz for MID TERM Exam Solved

Chapter 2. Digital Logic Basics

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

211: Computer Architecture Summer 2016

Digital Logic (2) Boolean Algebra

Karnaugh Maps for Combinatorial Logic CS 64: Computer Organization and Design Logic Lecture #12

Number System. Decimal to binary Binary to Decimal Binary to octal Binary to hexadecimal Hexadecimal to binary Octal to binary

SAMPLE ANSWERS MARKER COPY

Combinational Logic. By : Ali Mustafa

CHAPTER III BOOLEAN ALGEBRA

Chapter 7 Combinational Logic Networks

CHAPTER 5 KARNAUGH MAPS

Save from: cs. Logic design 1 st Class أستاذ المادة: د. عماد

CHAPTER III BOOLEAN ALGEBRA

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

ECE 2300 Digital Logic & Computer Organization

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

1 Boolean Algebra Simplification

Simplification of Boolean Functions. Dept. of CSE, IEM, Kolkata

Unit 3 Session - 9 Data-Processing Circuits

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

Computer Science Final Examination Friday December 14 th 2001

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

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

ECEN 248: INTRODUCTION TO DIGITAL SYSTEMS DESIGN. Week 2 Dr. Srinivas Shakkottai Dept. of Electrical and Computer Engineering

Part 5: Digital Circuits

Digital Logic Appendix A

Combinational Logic. Course Instructor Mohammed Abdul kader

UNIT 5 KARNAUGH MAPS Spring 2011

This form sometimes used in logic circuit, example:

E&CE 223 Digital Circuits & Systems. Lecture Transparencies (Boolean Algebra & Logic Gates) M. Sachdev

Binary logic consists of binary variables and logical operations. The variables are

Philadelphia University Student Name: Student Number:

Lecture 5: NAND, NOR and XOR Gates, Simplification of Algebraic Expressions

Review for Test 1 : Ch1 5

Optimizations and Tradeoffs. Combinational Logic Optimization

MC9211 Computer Organization

Computer Organization I Test 1/Version 1 CMSC 2833 Autumn 2007

Boolean Algebra. Digital Logic Appendix A. Postulates, Identities in Boolean Algebra How can I manipulate expressions?

Advanced Boolean Logic and Applications to Control Systems

E&CE 223 Digital Circuits & Systems. Lecture Transparencies (Boolean Algebra & Logic Gates) M. Sachdev. Section 2: Boolean Algebra & Logic Gates

Signals and Systems Digital Logic System

EEE130 Digital Electronics I Lecture #4

Chapter 7 Logic Circuits

Chapter 2 Combinational Logic Circuits

Digital Logic Design ENEE x. Lecture 14

MODULAR CIRCUITS CHAPTER 7

EECE 202 (Network I) & EECE 208 (Lab)

CSE 140L Spring 2010 Lab 1 Assignment Due beginning of the class on 14 th April

UNIT II COMBINATIONAL CIRCUITS:


EE40 Lec 15. Logic Synthesis and Sequential Logic Circuits

Boolean Algebra. Digital Logic Appendix A. Boolean Algebra Other operations. Boolean Algebra. Postulates, Identities in Boolean Algebra

ELECTRONICS & COMMUNICATION ENGINEERING PROFESSIONAL ETHICS AND HUMAN VALUES

Boolean Algebra, Gates and Circuits

University of Florida EEL 3701 Fall 2014 Dr. Eric. M. Schwartz Department of Electrical & Computer Engineering Wednesday, 15 October 2014

DE58/DC58 LOGIC DESIGN DEC 2014

Digital Logic Design. Combinational Logic

Sample Test Paper - I

Total Time = 90 Minutes, Total Marks = 100. Total /10 /25 /20 /10 /15 /20

Numbers & Arithmetic. Hakim Weatherspoon CS 3410, Spring 2012 Computer Science Cornell University. See: P&H Chapter , 3.2, C.5 C.

BINARY CODES. Binary Codes. Computer Mathematics I. Jiraporn Pooksook Department of Electrical and Computer Engineering Naresuan University

Sample Marking Scheme

DIGITAL LOGIC CIRCUITS

UNIVERSITI TENAGA NASIONAL. College of Information Technology

Combinational Logic. Lan-Da Van ( 范倫達 ), Ph. D. Department of Computer Science National Chiao Tung University Taiwan, R.O.C.

Number System conversions

Combinational Logic. Review of Combinational Logic 1

Chapter 3 Combinational Logic Design

COMBINATIONAL LOGIC FUNCTIONS

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

CSE 140: Components and Design Techniques for Digital Systems

ELC224C. Karnaugh Maps

Carry Look Ahead Adders

Karnaugh Maps (K-Maps)

ENGG 1203 Tutorial - 2 Recall Lab 2 - e.g. 4 input XOR. Parity checking (for interest) Recall : Simplification methods. Recall : Time Delay

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

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

Combinational Logic Design/Circuits

University of Florida EEL 3701 Fall 1996 Dr. Eric M. Schwartz

WORKBOOK. Try Yourself Questions. Electrical Engineering Digital Electronics. Detailed Explanations of

II. COMBINATIONAL LOGIC DESIGN. - algebra defined on a set of 2 elements, {0, 1}, with binary operators multiply (AND), add (OR), and invert (NOT):

Transcription:

CSCI 220: Computer Architecture-I Instructor: Pranava K. Jha BCD Codes Q. Give representation of the decimal number 853 in each of the following codes. (a) 8421 code (c) 84(-2)(-1) code (b) Excess-three code (d) 753(-6) code. Decimal digit 8421 code Excess-three code 84(-2)(-1) code 753(-6) code 8 1000 1011 1000 0110 5 0101 1000 1011 0100 3 0011 0110 0101 0010 A code for the decimal number 853 is obtainable by carefully juxtaposing the respective four-bit groups for 8, 5 and 3, respectively. Decimal number 8421 code Excess-three code 84(-2)(-1) code 753(-6) code 853 100001010011 101110000110 100010110101 011001000010 Q. Encode the decimal digits 0 through 9 with four bits using 832( 4) code. Is this code self-complementing? Explain. Decimal digit 832( 4) code 0 0 0 0 0 1 0 1 1 1 2 0 0 1 0 3 0 1 0 0 4 1 0 0 1 5 0 1 1 0 6 1 0 1 1 7 1 1 0 1 8 1 0 0 0 9 1 1 1 1 The code is indeed self-complementing. This is because if a decimal digit r receives the code abcd, then the decimal digit 9 r receives the code a b c d, where a = 1 a. 1 of 8

Q. Prove that in a four-bit weighted BCD code with all positive weights, at most one weight can exceed 4. Let w 1, w 2, w 3 and w 4 be the four positive weights in weighted BCD code. Assume by way of contradiction that there are at least two weights that are greater than 4, i.e., a maximum of two weights are between 1 and 4. Without loss of generality, assume that 1 w 1 w 2 4, and w 3, w 4 5. The following table shows that at least one decimal digit cannot be represented in such a code. w 1 w 2 1 1 Cannot represent 3 or 4. 1 2 Cannot represent 4. 1 3 Cannot represent 2. 1 4 Cannot represent 2 or 3. 2 2 Cannot represent 1 or 3. 2 3 Cannot represent 1 or 4. 2 4 Cannot represent 1 or 3. 3 3 Cannot represent 1, 2 or 4. 3 4 Cannot represent 1 or 2. 4 4 Cannot represent 1, 2 or 3. The situation is worse if there is just one weight between 1 and 4. Contradiction! Q. Consider the string 100010010111. What decimal number does it represent if it is viewed as a string in (a) BCD, (b) Excess-three code and (c) 84(-2)(-1) code? Examine 100010010111 as a string of four-bit groups as below. 1000 1001 0111 Now replace each four-bit group by the corresponding decimal digit in the respective code. BCD Excess-three code 84(-2)(-1) code 100010010111 897 564 871 2 of 8

Q. Complete the following table with respect to 7536 BCD code. Decimal digit 7536 code 0 0 0 0 0 1 1 0 0 1 2 0 1 1 1 3 0 0 1 0 4 1 0 1 1 5 0 1 0 0 6 1 1 0 1 7 1 0 0 0 8 0 1 1 0 9 1 1 1 1 7536 code is an example of a self-complementing code. Such a code has the property that the code word for the 9's complement of a digit is obtainable by complementing the individual bits of the digit's code word. Other self-complementing codes include excessthree code and8421code. Self-complementing codes were used in early calculators. Q. A four-input, one-output circuit is to be designed. The inputs are 7536 code groups. The output f is (i) a 1 if the digit D represented is in the range 0 D 3, (ii) a 0 if the digit D is in the range 4 D 9, and (iii) a if the digit D is invalid, i.e., not in the range 0 D 9. Complete the following table for this purpose. 7 5 3 6 w x y z Digit D Output f 0 0 0 0 0 1 0 0 0 1 0 0 1 0 3 1 0 0 1 1 0 1 0 0 5 0 0 1 0 1 0 1 1 0 8 0 0 1 1 1 2 1 1 0 0 0 7 0 1 0 0 1 1 1 1 0 1 0 1 0 1 1 4 0 1 1 0 0 1 1 0 1 6 0 1 1 1 0 1 1 1 1 9 0 3 of 8

Q. Prove that in a self-complementing BCD code, which can have both positive and negative weights, the algebraic sum of all the weights must be 9. A self-complementing BCD code has the property that the four-bit binary string corresponding to a digit d is obtainable from the four-bit binary string corresponding to (9 d) through bit-wise complementation. If a digit d is representable as the four-bit binary string a 3 a 2 a 1 a 0, then the digit (9 d) is representable as (1 a 3 )(1 a 2 ) (1 a 1 ) (1 a 0 ), where 0 d 9 and 0 a i 1. Let w 3, w 2, w 1 and w 0 be the weights of a self-complementing BCD code. Further, let a 3 a 2 a 1 a 0 be the code for the digit 0, whence (1 a 3 )(1 a 2 ) (1 a 1 ) (1 a 0 ) is the code for the digit 9. It is clear that 0 = a 3 w 3 + a 2 w 2 + a 1 w 1 + a 0 w 0. 9 = (1 a 3 )w 3 + (1 a 2 )w 2 + (1 a 1 )w 1 + (1 a 0 )w 0. A simple summation yields: 9 = w 3 + w 2 + w 1 + w 0. QED Q. Encode the decimal digits 0 through 9 with four bits using the following weighted BCD codes. For each code, state whether it is self-complementing or not: (i) 7635 code, (ii) 8324 code. 7635 code 8324 code 0 0000 1 0101 2 1001 3 0010 4 0111 5 1011 6 0100 7 1000 8 1101 9 0110 0 0000 1 0111 2 0010 3 0100 4 1001 5 0110 6 1011 7 1101 8 1000 9 1111 It is clear that 7635 code is not self-complementing while8324 code is. 4 of 8

Q. The following block diagram corresponds to a code converter that takes a four-bit representation of a decimal digit in 84(-2)(-1) code and produces the corresponding fourbit representation in 8421 code. A B C D 8 8 4 4-2 2-1 1 W X Y Z Develop simplified expressions for W, X, Y and Z in terms of A, B, C and D. Make use of don t-care conditions. The following table is immediate. 84(-2)(-1) code Decimal BCD A B C D digit W X Y Z 0 0 0 0 0 0 0 0 0 0 0 0 1 0 0 1 0 0 0 1 1 0 1 0 0 4 0 1 0 0 0 1 0 1 3 0 0 1 1 0 1 1 0 2 0 0 1 0 0 1 1 1 1 0 0 0 1 1 0 0 0 8 1 0 0 0 1 0 0 1 7 0 1 1 1 1 0 1 0 6 0 1 1 0 1 0 1 1 5 0 1 0 1 1 1 0 0 1 1 0 1 1 1 1 0 1 1 1 1 9 1 0 0 1 Karnaugh maps follow. 5 of 8

K-map for W K-map for X Simplified expressions and a circuit diagram follow. w = AB +AC D. x = B C + B D +BC D. y = C D + CD. z = D. K-map for Y K-map for Z 6 of 8

Q. The following block diagram corresponds to a code converter that takes a four-bit representation of a decimal digit in 8421 code and produces the corresponding four-bit representation in excess-three code. A B C D 8 4 2 1 W W Y Z Present the truth table for this purpose. Make use of don t-care conditions. 8421 code A B C D Decimal digit Excess-three code W X Y Z 0 0 0 0 0 0 0 1 1 0 0 0 1 1 0 1 0 0 0 0 1 0 2 0 1 0 1 0 0 1 1 3 0 1 1 0 0 1 0 0 4 0 1 1 1 0 1 0 1 5 1 0 0 0 0 1 1 0 6 1 0 0 1 0 1 1 1 7 1 0 1 0 1 0 0 0 8 1 0 1 1 1 0 0 1 9 1 1 0 0 1 0 1 0 1 0 1 1 1 1 0 0 1 1 0 1 1 1 1 0 1 1 1 1 7 of 8

Q. Find the binary representation for each of the following BCD numbers: 0100100001100111 001101111000.01110101 (0100 1000 0110 0111) BCD = (4867) 10 = (1001100000011) 2 (0011 0111 1000.0111 0101) BCD = (378.75) 10 = (101111010.11) 2 Q. Consider the binary string 100010010111. What decimal number does it represent if it is viewed as a string in (a) BCD, (b) Excess-three code and (c) 84(-2)(-1) code? Examine 100010010111 as a string of four-bit groups as below. 1000 1001 0111 Now replace each four-bit group by the corresponding decimal digit in the respective code. Binary string 8421 (BCD) Excess-three code 84(-2)(-1) code 100010010111 897 564 871 o 8 of 8