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



Similar documents
The string of digits in the binary number system represents the quantity

EE 261 Introduction to Logic Circuits. Module #2 Number Systems

Oct: 50 8 = 6 (r = 2) 6 8 = 0 (r = 6) Writing the remainders in reverse order we get: (50) 10 = (62) 8

CPEN Digital Logic Design Binary Systems

Digital System Design Prof. D Roychoudhry Department of Computer Science and Engineering Indian Institute of Technology, Kharagpur

Levent EREN A-306 Office Phone: INTRODUCTION TO DIGITAL LOGIC

2011, The McGraw-Hill Companies, Inc. Chapter 3

EE360: Digital Design I Course Syllabus

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

LSN 2 Number Systems. ECT 224 Digital Computer Fundamentals. Department of Engineering Technology

Binary Representation. Number Systems. Base 10, Base 2, Base 16. Positional Notation. Conversion of Any Base to Decimal.

Number and codes in digital systems

COMBINATIONAL CIRCUITS

Lecture 11: Number Systems

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

CSI 333 Lecture 1 Number Systems

Goals. Unary Numbers. Decimal Numbers. 3,148 is s 100 s 10 s 1 s. Number Bases 1/12/2009. COMP370 Intro to Computer Architecture 1

Course Requirements & Evaluation Methods

NUMBER SYSTEMS. 1.1 Introduction

Lecture 2. Binary and Hexadecimal Numbers

BINARY CODED DECIMAL: B.C.D.

Chapter 1: Digital Systems and Binary Numbers

Solution for Homework 2

Binary Adders: Half Adders and Full Adders

Chapter 2. Binary Values and Number Systems

University of St. Thomas ENGR Digital Design 4 Credit Course Monday, Wednesday, Friday from 1:35 p.m. to 2:40 p.m. Lecture: Room OWS LL54

Number Representation

Design and Development of Virtual Instrument (VI) Modules for an Introductory Digital Logic Course

Computer Science 281 Binary and Hexadecimal Review

Counters and Decoders

A Step towards an Easy Interconversion of Various Number Systems

COMP 250 Fall 2012 lecture 2 binary representations Sept. 11, 2012

3. Convert a number from one number system to another

Binary Numbers. Binary Octal Hexadecimal

Binary Division. Decimal Division. Hardware for Binary Division. Simple 16-bit Divider Circuit

Operating Manual Ver.1.1

Systems I: Computer Organization and Architecture

Useful Number Systems

Number Conversions Dr. Sarita Agarwal (Acharya Narendra Dev College,University of Delhi)

Binary Representation

Philadelphia University Faculty of Information Technology Department of Computer Science Semester, 2007/2008.

Numeral Systems. The number twenty-five can be represented in many ways: Decimal system (base 10): 25 Roman numerals:

Number Systems and Radix Conversion

NUMBER SYSTEMS. William Stallings

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

Binary, Hexadecimal, Octal, and BCD Numbers

Today. Binary addition Representing negative numbers. Andrew H. Fagg: Embedded Real- Time Systems: Binary Arithmetic

Combinational circuits

PROGRAMMABLE LOGIC CONTROLLERS Unit code: A/601/1625 QCF level: 4 Credit value: 15 TUTORIAL OUTCOME 2 Part 1

DEPARTMENT OF INFORMATION TECHNLOGY

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

A Comparison of Student Learning in an Introductory Logic Circuits Course: Traditional Face-to-Face vs. Fully Online

COMPSCI 210. Binary Fractions. Agenda & Reading

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

=

(Refer Slide Time: 00:01:16 min)

2 Number Systems. Source: Foundations of Computer Science Cengage Learning. Objectives After studying this chapter, the student should be able to:

Digital to Analog and Analog to Digital Conversion

Chapter 4: Computer Codes

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

Understanding Logic Design

ANALOG & DIGITAL ELECTRONICS

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

Asynchronous counters, except for the first block, work independently from a system clock.

To convert an arbitrary power of 2 into its English equivalent, remember the rules of exponential arithmetic:

Base Conversion written by Cathy Saxton

Numbering Systems. InThisAppendix...

This Unit: Floating Point Arithmetic. CIS 371 Computer Organization and Design. Readings. Floating Point (FP) Numbers

Digital codes. Resources and methods for learning about these subjects (list a few here, in preparation for your research):

NUMBER SYSTEMS APPENDIX D. You will learn about the following in this appendix:

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

5 Combinatorial Components. 5.0 Full adder. Full subtractor

1. Give the 16 bit signed (twos complement) representation of the following decimal numbers, and convert to hexadecimal:

HOMEWORK # 2 SOLUTIO

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

This 3-digit ASCII string could also be calculated as n = (Data[2]-0x30) +10*((Data[1]-0x30)+10*(Data[0]-0x30));

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

Number Systems. Introduction / Number Systems

Computers. Hardware. The Central Processing Unit (CPU) CMPT 125: Lecture 1: Understanding the Computer

Binary Numbering Systems

Sistemas Digitais I LESI - 2º ano

Digital Systems. Syllabus 8/18/2010 1

COURSE TITLE: INTRODUCTION TO COMPUTER DESIGN

Accentuate the Negative: Homework Examples from ACE

Logic Reference Guide

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

CHAPTER IX REGISTER BLOCKS COUNTERS, SHIFT, AND ROTATE REGISTERS

CS321. Introduction to Numerical Methods

A Course Material on DIGITAL PRINCIPLES AND SYSTEM DESIGN

Decimal Number (base 10) Binary Number (base 2)

WEEK 8.1 Registers and Counters. ECE124 Digital Circuits and Systems Page 1

Analog/Digital Conversion. Analog Signals. Digital Signals. Analog vs. Digital. Interfacing a microprocessor-based system to the real world.

3.Basic Gate Combinations

CpE358/CS381. Switching Theory and Logical Design. Class 10

Digital Electronics Detailed Outline

Digital Fundamentals. Lab 8 Asynchronous Counter Applications

CpE358/CS381. Switching Theory and Logical Design. Class 4

MEP Y9 Practice Book A

LED Bulb Manual. Aeotec by Aeon Labs LED Bulb.

Transcription:

Digital Design Assoc. Prof. Dr. Berna Örs Yalçın Istanbul Technical University Faculty of Electrical and Electronics Engineering Office Number: 2318 E-mail: siddika.ors@itu.edu.tr

Grading 1st Midterm - % 18 31th October 2013 2nd Midterm % 18 07 th December 2013 5 Homeworks - % 6 Final Exam - % 34 Lab - % 24 2

Goals and objectives The goal of this course is to: provide a good understanding of the digital systems. introduce the basic building blocks of digital design including combinational logic circuits, combinational logic design, arithmetic functions and circuits and sequential circuits. Showing how these building blocks are employed in larger scale digital systems Having successfully completed this course, the student will: acknowledge the importance of digital systems. Design a digital circuit given a Boolean function. Get familiar with typical combinatorial (adders, decoders, multiplexers, encoders) and sequential (D flip-flops, counters, registers, shift registers) components. Understand how larger systems are organized. 3

References Text Books : Digital Design, M. Morris Mano, Michael D. Ciletti, Logic and Computer Design Fundamentals, 4/E, M. Morris Mano and Charles Kime, Prentice Hall, 2008. Slides and all anouncements : http://ee.yeditepe.edu.tr/labs/ ee241/ 4

Overview of Chapter 1 C ha pte r 1 5 Digital Systems, Computers Information Representation Number Systems [binary, octal and hexadecimal] Arithmetic Operations Base Conversion Decimal Codes [BCD (binary coded decimal)]

What is a Digital System? One characteristic: Ability of manipulating discrete elements of information A set that has a finite number of elements contains discrete information Examples for discrete sets Decimal digits {0, 1,, 9} Alphabet {A, B,, Y, Z} Binary digits {0, 1} One important problem how to represent the elements of discrete sets in physical systems? 6

DIGITAL & COMPUTER SYSTEMS - Digital System Takes a set of discrete information inputs and discrete internal information (system state) and generates a set of discrete information outputs. C ha pte r 1 7 Discrete Inputs Discrete Information Processing System Discrete Outputs System State

Types of Digital Systems No state present Combinational Logic System Output = Function(Input) State present State updated at discrete times => Synchronous Sequential System State updated at any time =>Asynchronous Sequential System State = Function (State, Input) Output = Function (State) or Function (State, Input) C ha pte r 1 8

Digital System Example: C ha pte r 1 9 A Digital Counter (e. g., odometer): Count Up Reset 0 0 1 3 5 6 4 Inputs: Count Up, Reset Outputs: Visual Display State: "Value" of stored digits

Analog Digital Signals The physical quantities in real world like current, voltage, temperature values change in a continuous range. The signals that can take any value between the boundaries are called analog signals. Information take discrete values in digital systems. Binary digital signals can take one of the two possible values: 0-1, high-low, openclosed. 10

Conversion of Analog Signals to Digital Signals Quantized Signal 11

How to Represent? In electronics circuits, we have electrical signals voltage current Different strengths of a physical signal can be used to represent elements of the discrete set. Which discrete set? Binary set is the easiest two elements {0, 1} Just two signal levels: 0 V and 4 V This is why we use binary system to represent the information in our digital system. 12

Binary System Binary set {0, 1} The elements of binary set, 0 and 1 are called binary digits or shortly bits. How to represent the elements of other discrete sets Decimal digits {0, 1,, 9} Alphabet {A, B,, Y, Z} Elements of any discrete sets can be represented using groups of bits. 9 1001 A 1000001 13

How Many Bits? What is the formulae for number of bits to represent a discrete set of n elements {0, 1, 2, 3} 00 0, 01 1, 10 2, ands 11 3. {0, 1, 2, 3, 4, 5, 6, 7} 000 0, 001 1, 010 2, ands 011 3 100 4, 101 5, 110 6, ands 111 7. The formulae, then,? If n = 9, then 4 bits are needed 14

NUMBER SYSTEMS Representation Positive radix, positional number systems C ha pte r 1 15 A number with radix r is represented by a string of digits: A n - 1 A n - 2 A 1 A 0. A - 1 A - 2 A - m + 1 A - m in which 0 A i < r and. is the radix point. The string of digits represents the power series: i = n - 1 j = - 1 ( ) ( ) A r i A r j i j (Number) r = + i = 0 j = - m (Integer Portion) + (Fraction Portion)

Representation of positive numbers Örnek: 215 10 =(1101 0111) 2 = 1 2 7 +1 2 6 +0 2 5 +1 2 4 +0 2 3 +1 2 2 +1 2 1 +1 2 0 Most Signaficant Bit (MSB) Least Signaficant Bit (LSB) The largest postive number that can be represented by 8 bits is: (1111 1111) 2 =255 10 The smallest postive number that can be represented by 8 bits is: (0000 0000) 2 =0 10 16

Some Bases Name Base Digits Binary 2 0,1 Octal 8 0,1,2,3,4,5,6,7 Decimal 10 0,1,2,3,4,5,6,7,8,9 Hexadecimal 16 0,1,2,3,4,5,6,7,8,9,A,B,C,D,E,F 17

Some Numbers in Different Bases Decimal (Base 10) Binary (Base 2) Octal (Base 8) Hexa decimal (Base 16) 00 00000 00 00 01 00001 01 01 02 00010 02 02 03 00011 03 03 04 00100 04 04 05 00101 05 05 06 00110 06 06 07 00111 07 07 08 01000 10 08 09 01001 11 09 10 01010 12 0A 11 0101 1 13 0B 12 01100 14 0C 13 01101 15 0D 14 01110 16 0E 15 01111 17 0F 16 10000 20 10 18

Base Conversions From base-r to decimal is easy expand the number in power series and add all the terms Reverse operation is somewhat more difficult Simple idea: divide the decimal number successively by r accumulate the remainders. If there is a fraction, then integer part and fraction part are handled separately. 19

Example: 46.6875 10 to base 2 Convert 46 to binary 46/2=23 remainder 0 23/2=11 remainder 1 11/2=5 remainder 1 5/2=2 remainder 1 2/2=1 remainder 0 1/2=0 remainder 1 Convert 0.6875 to binary 0.6875*2=1.375 0.375*2=0.75 0.75*2=1.5 0.5*2=1 0*2=0 Put two results together with a radix point 101110.10110 20 2

Example: 46.6831 10 to hexadecimal (base 16) Convert 46 to base 16 46/16=2 remainder 14 2/16=0 remainder 2 Convert 0.6831 to base 16 0.6831*16=10.9296 0.9296*16=14.8736 0.8736*16=13.9776 0.9776*16=15.6416 Put two results together with a fraction dot 2E.AEDF 16 21

Conversion from base r to base decimal Convert 101110.10110 2 to base 10 101110 2 = 1 32 + 0 16 +1 8 +1 4 + 1 2 +0 1 = 32 + 8 + 4 + 2 = 46 0.1011 2 = 1/2 + 1/8 + 1/16 = 0.5000 + 0.1250 + 0.0625 = 0.6875 22

Conversions between Binary, Octal and Hexadecimal Octal to Binary 743.056 8 =111 100 011.000 101 110 2 Hexadecimal to Binary A49.0C6 16 =1010 0100 1001.0000 1100 0110 2 Binary to Octal 1 011 100 011.000 101 110 1 2 =1343.0564 8 Binary to Hexadecimal 1 1010 0100 1001.0010 1100 0110 1 2 =1A49.2C68 16 Octal and hexadecimal representations are more compact. Therefore, we use them in order to communicate with computers directly using their internal representation 23

Representation of Negative Numbers In order to differ between positive and negative numbers the MSB is used. If 0 positive If 1 negative The positive numbers that can be shown by 8 bits are between 0000 0000 and 0111 1111, hence between 0 and + 127. 2 s complement method is used for representation of negative numbers. 2 s complement of a positive number shows the negative of it. In order to find the 2 s complement of a number 1 s complement is found: 0s are changed to 1s, 1s are changed to 0s. 1 is added to 1 s complement of the number. 24

Examples for Negative Numbers 0 0 0 0 0 1 0 1 + 5 1 s complement Addition of 1 1 1 1 1 1 0 1 0 1 2 s complement 1 1 1 1 1 0 1 1 Negative number - 5 25

Examples for Negative Numbers 1 1 1 1 1 0 1 1-5 1 s complement Addition of 1 0 0 0 0 0 1 0 0 1 2 s complement 0 0 0 0 0 1 0 1 + 5 Pozitive number 26

ARITHMETIC OPERATIONS - Binary Arithmetic Single Bit Addition with Carry Multiple Bit Addition Multiple Bit Subtraction Multiplication C ha pte r 1 27

Single Bit Binary Addition with Carry C ha pte r 1 28

Addition of Positive Numbers Carry 00000 01100 X 01100 12 10110 22 Y +10001 +17 +10111 +23 Sum 11101 29 101101 45 Note: 1. The carry input to the LSB is always 0. 2. The sum of two n-bit numbers has n+1- bits. 29

Addition of Positive and Negative Numbers Represented By 2 s Complement Carry 001 0 0100 X 1101-3 0011 3 Y +0001 +1 +0010 +2 111 0 01 01 Sum -2 5 Negative Positive 30

Addition of Positive and Negative Numbers Represented By 2 s Complement Carry 111 1 0 111 0 0 X 1101-3 0011 3 Y +1111-1 +1110-2 1110 0 1 00 01 Sum -4 1 ignored negative positive ignored 31

Addition of Positive and Negative Numbers Represented By 2 s Complement Carry 1000 0000 X 0100 4 1010-6 Y +0101 +5 +1101-3 Sum 1001 9 10111-9 Is the sum negative? ignored Is the sum positive? Overflow occured. The largest positive number that can be represented by 4-bits is +7. Larger numbers can not be reprsented by 4-bits. The smallest negative number that can be represented by 4-bits is -8. Smaller numbers can not be reprsented by 4-bits. The number of bits to be used in the representation of the numbers should be decided according to the boundaries of the inputs and the outputs of the operations. 32

Subtraction of Positive Numbers 33 Borrow 00000 00110 X 10110 22 10110 22 Y - 10010-18 - 10011-19 Difference 00100 4 00011 3 Note: The borrow input to the LSB is always 0. If Y>X, then X and Y are exchanged and sign is put in front of the result.

Subtraction of Numbers With Sign Bit and 2 s complement 34 X 3 0011 0011 3 Y -1-0001 2 s complement +1111 +(-1) Difference 2 10010 2 ignored X 3 0011 0011 3 Y -4-0100 2 s complement +1100 +(-4) Difference-1 1111-1 X 3 0011 0011 3 Y -(-1) -1111 2 s complement +0001 +1 Difference 4 0100 4 positive negative positive

Subtraction of Numbers With Sign Bit and 2 s complement X 1 0001 0001 1 Y -(-7) -1001 2 s complement +0111 +7 Difference 8 Is the result negative? 1000 8 X -5 1011 1011-5 Y -4-0100 2 s complement +1100 +(-4) ignored Difference-9 10111-9 35 Is the result positive? Overflow occured. The largest positive number that can be represented by 4-bits is +7. Larger numbers can not be represented by 4-bits. The smallest negative number that can be represented by 4-bits is -8. Smaller numbers can not be reprsented by 4-bits. The number of bits to be used in the representation of the numbers should be decided according to the boundaries of the inputs and the outputs of the operations.

Binary Multiplication C ha pte r 1 36

Binary Numbers and Binary Coding Flexibility of representation Within constraints below, can assign any binary combination (called a code word) to any data as long as data is uniquely encoded. Information Types Numeric Must represent range of data needed Very desirable to represent data such that simple, straightforward computation for common arithmetic operations permitted Tight relation to binary numbers Non-numeric Greater flexibility since arithmetic operations not applied. Not tied to binary numbers C ha pte r 1 37

Non-numeric Binary Codes Given n binary digits (called bits), a binary code is a mapping from a set of represented elements to a subset of the 2 n binary numbers. Example: A binary code for the seven colors of the rainbow Code 100 is not used Color Red Orange Yellow Green Blue Indigo Violet Binary Number 000 001 010 011 101 110 111 C ha pte r 1 38

Number of Elements Represented C ha pte r 1 39 Given n digits in radix r, there are r n distinct elements that can be represented. But, you can represent m elements, m < r n Examples: You can represent 4 elements in radix r = 2 with n = 2 digits: (00, 01, 10, 11). You can represent 4 elements in radix r = 2 with n = 4 digits: (0001, 0010, 0100, 1000). This second code is called a "one hot" code.