EE292: Fundamentals of ECE

Similar documents
Number System. Introduction. Decimal Numbers

Microcomputers. Outline. Number Systems and Digital Logic Review

Bawar Abid Abdalla. Assistant Lecturer Software Engineering Department Koya University

CPE300: Digital System Architecture and Design

1010 2?= ?= CS 64 Lecture 2 Data Representation. Decimal Numbers: Base 10. Reading: FLD Digits: 0, 1, 2, 3, 4, 5, 6, 7, 8, 9

ECE 550D Fundamentals of Computer Systems and Engineering. Fall 2017

Number representations

DIGITAL SYSTEM DESIGN

Digital Logic Design Exercises. Assignment 1

Lecture 2: Number Systems

CMPE223/CMSE222 Digital Logic Design. Positional representation

Summary of Course Coverage

COMP combinational logic 1 Jan. 18, 2016

Lecture 3: Binary Subtraction, Switching Algebra, Gates, and Algebraic Expressions

ELECTRICAL AND COMPUTER ENGINEERING DEPARTMENT, OAKLAND UNIVERSITY ECE-278: Digital Logic Design Fall Notes - Unit 4. hundreds.

ELECTRICAL AND COMPUTER ENGINEERING DEPARTMENT, OAKLAND UNIVERSITY ECE-2700: Digital Logic Design Winter Notes - Unit 4. hundreds.

DIGITAL SYSTEM FUNDAMENTALS (ECE 421) DIGITAL ELECTRONICS FUNDAMENTAL (ECE 422) COURSE / CODE NUMBER SYSTEM

Semester Transition Point. EE 109 Unit 11 Binary Arithmetic. Binary Arithmetic ARITHMETIC

60-265: Winter ANSWERS Exercise 4 Combinational Circuit Design

BINARY SYSTEM. Binary system is used in digital systems because it is:

CS/COE 0447 Example Problems for Exam 2 Spring 2011

Positional notation Ch Conversions between Decimal and Binary. /continued. Binary to Decimal

ECE 2030B 1:00pm Computer Engineering Spring problems, 5 pages Exam Two 10 March 2010

Slide Set 1. for ENEL 339 Fall 2014 Lecture Section 02. Steve Norman, PhD, PEng

Binary Adders: Half Adders and Full Adders

Binary Values. CSE 410 Lecture 02

DIGITAL ARITHMETIC: OPERATIONS AND CIRCUITS

SWITCHING THEORY AND LOGIC CIRCUITS

Computer Sc. & IT. Digital Logic. Computer Sciencee & Information Technology. 20 Rank under AIR 100. Postal Correspondence

that system. weighted value associated with it. numbers. a number. the absence of a signal. MECH 1500 Quiz 2 Review Name: Class: Date:

Basic Arithmetic (adding and subtracting)

Inf2C - Computer Systems Lecture 2 Data Representation

SCHOOL OF ENGINEERING & BUILT ENVIRONMENT. Mathematics. Numbers & Number Systems

MACHINE LEVEL REPRESENTATION OF DATA

Outline. What Digit? => Number System. Decimal (base 10) Significant Digits. Lect 03 Number System, Gates, Boolean Algebra. CS221: Digital Design

Combinational Devices and Boolean Algebra

Logic Design: Part 2

Introduction to Computers and Programming. Numeric Values

1. Mark the correct statement(s)

CS 265. Computer Architecture. Wei Lu, Ph.D., P.Eng.

Department of Electrical and Computer Engineering University of Wisconsin - Madison. ECE/CS 352 Digital System Fundamentals.

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

Data Representation COE 301. Computer Organization Prof. Muhamed Mudawar

Lecture 6: Signed Numbers & Arithmetic Circuits. BCD (Binary Coded Decimal) Points Addressed in this Lecture

Digital Arithmetic. Digital Arithmetic: Operations and Circuits Dr. Farahmand

Logic Gates and Boolean Algebra ENT263

IT 201 Digital System Design Module II Notes

Agenda EE 224: INTRODUCTION TO DIGITAL CIRCUITS & COMPUTER DESIGN. Lecture 1: Introduction. Go over the syllabus 3/31/2010

EE 109 Unit 6 Binary Arithmetic

1. NUMBER SYSTEMS USED IN COMPUTING: THE BINARY NUMBER SYSTEM

Hybrid Electronics Laboratory

Fundamentals of Programming

T02 Tutorial Slides for Week 2


CO Computer Architecture and Programming Languages CAPL. Lecture 9

Chapter 1 Review of Number Systems

Moodle WILLINGDON COLLEGE SANGLI. ELECTRONICS (B. Sc.-I) Introduction to Number System

SIR C.R.REDDY COLLEGE OF ENGINEERING, ELURU DEPARTMENT OF INFORMATION TECHNOLOGY LESSON PLAN

ECE 2030D Computer Engineering Spring problems, 5 pages Exam Two 8 March 2012

Number Systems. Both numbers are positive

Slide Set 1. for ENEL 353 Fall Steve Norman, PhD, PEng. Electrical & Computer Engineering Schulich School of Engineering University of Calgary

ECE 2020B Fundamentals of Digital Design Spring problems, 6 pages Exam Two Solutions 26 February 2014

Computer Architecture and System Software Lecture 02: Overview of Computer Systems & Start of Chapter 2

Number Systems Standard positional representation of numbers: An unsigned number with whole and fraction portions is represented as:

User. Application program. Interfaces. Operating system. Hardware

Number Systems and Conversions UNIT 1 NUMBER SYSTEMS & CONVERSIONS. Number Systems (2/2) Number Systems (1/2) Iris Hui-Ru Jiang Spring 2010

DLD VIDYA SAGAR P. potharajuvidyasagar.wordpress.com. Vignana Bharathi Institute of Technology UNIT 1 DLD P VIDYA SAGAR

Fundamentals of Programming Session 2

Level ISA3: Information Representation

Chapter 4: The Building Blocks: Binary Numbers, Boolean Logic, and Gates. Invitation to Computer Science, C++ Version, Third Edition

Basic Definition INTEGER DATA. Unsigned Binary and Binary-Coded Decimal. BCD: Binary-Coded Decimal

E40M. Binary Numbers, Codes. M. Horowitz, J. Plummer, R. Howe 1

Boolean Algebra and Logic Gates

2.1 Binary Logic and Gates

Binary Addition. Add the binary numbers and and show the equivalent decimal addition.

DIGITAL CIRCUIT LOGIC UNIT 7: MULTI-LEVEL GATE CIRCUITS NAND AND NOR GATES

COMP2611: Computer Organization. Data Representation

CPE 323 REVIEW DATA TYPES AND NUMBER REPRESENTATIONS IN MODERN COMPUTERS

Logic, Words, and Integers

Fundamentals of Programming (C)

CPE 323 REVIEW DATA TYPES AND NUMBER REPRESENTATIONS IN MODERN COMPUTERS

Module 1: Information Representation I -- Number Systems

D I G I T A L C I R C U I T S E E

Chapter 2 Number System

GC03 Boolean Algebra

Introduction to Computer Architecture

Computer Organization and Programming

Computer Arithmetic. Appendix A Fall 2003 Lec.03-58

Unit 7 Number System and Bases. 7.1 Number System. 7.2 Binary Numbers. 7.3 Adding and Subtracting Binary Numbers. 7.4 Multiplying Binary Numbers

CDA 3103 Computer Organization Exam 1 (Sep. 22th, 2014)

A complement number system is used to represent positive and negative integers. A complement number system is based on a fixed length representation

Number Systems CHAPTER Positional Number Systems

Digital Systems and Binary Numbers

END-TERM EXAMINATION

MC1601 Computer Organization

DLD VIDYA SAGAR P. potharajuvidyasagar.wordpress.com. Vignana Bharathi Institute of Technology UNIT 3 DLD P VIDYA SAGAR

Combinational Circuits

1. Draw general diagram of computer showing different logical components (3)

CHAPTER 1 Numerical Representation

Binary Arithmetic CS 64: Computer Organization and Design Logic Lecture #2 Fall 2018

Transcription:

EE292: Fundamentals of ECE Fall 2012 TTh 10:00-11:15 SEB 1242 Lecture 22 121115 http://www.ee.unlv.edu/~b1morris/ee292/

2 Outline Review Binary Number Representation Binary Arithmetic Combinatorial Logic

3 Digital Signals A signal with discrete time variable and only a few restricted amplitude values Binary signals are the most common type of signal The output takes only two possible values The two output values are often given positive logical values of a 1 (high) or 0 (low)

4 Digital Words Bit a single binary digit Smallest amount of information that can be represented in a digital system Represents a yes/no for a digital variable E.g. R = 0, represents not raining while R = 1, represents raining In order to represent more complex information, bits can be combined into digital words A byte is 8 bits and a nibble is 4 bits (used often in computers, e.g. a byte to represent each key on a keyboard) Example RWS R for rain, W for wind, S for sunny RWS = 110 indicates it is raining, with winds, and cloudy (e.g. not sunny)

5 Positional Notation for Numbers Base B number B symbols per digit Base 10 (Decimal): 0, 1, 2, 3, 4, 5, 6, 7, 8, 9 Base 2 (binary) 0, 1 Number representation d N 1 d N 2 d 2 d 1 d 0 is N digit number 2 N different numbers can be represented Value =d N 1 B N 1 + d N 2 B N 2 + + d 1 B 1 + d 0 B 0 Examples (Decimal): 90 = 9 10 1 + 0 10 0 (Binary): 1011010 = 1 2 6 + 0 2 5 + 1 2 4 + 1 2 3 + 0 2 2 + 1 2 1 + 0 2 0 = 64 + 16 + 8 + 2 = 90 7 binary digits needed for 2 digit decimal number

6 Conversion from Decimal to Base B Integer conversion is done by repeatedly dividing by the decimal number by base B The remainder is a base B digit Continue dividing until quotient equals zero Arrange into digital word from right to left

7 Conversion from Decimal to Binary Convert decimal 343 10 to binary (base 2)

8 Hexadecimal Number: Base 16 More human readable than binary Base with easy conversion to binary Any multiple of 2 base could work (e.g. octal) Hexadecimal digits Decimal 0 1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 Binary 0000 0001 0010 0011 0100 0101 0110 0111 1000 1001 1010 1011 1100 1101 1110 1111 Hex (16) 0 1 2 3 4 5 6 7 8 9 A B C D E F octal (8) 0 1 2 3 4 5 6 7 1 hex digit represents 16 decimal values or 4 binary digits Will use 0x to indicate hex digit

9 Hex/Binary Conversion Decimal 0 1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 binary 0000 0001 0010 0011 0100 0101 0110 0111 1000 1001 1010 1011 1100 1101 1110 1111 hex 0 1 2 3 4 5 6 7 8 9 A B C D E F Convert between 4-bits and a hex digit using the conversion table above Examples 1010 1100 0101 (binary) = 0xAC5 10111 (binary) = 0001 0111 (binary) = 0x17 0x3F9 = 0011 1111 1001 (binary) = 11 1111 1001 (binary)

10 Binary Arithmetic Addition in binary is the same as with decimal Only have 2 values (0, 1) in binary Sum Carry 0 + 0 = 0 0 0 + 1 = 1 0 1 + 1 = 0 1 1 + 1 + 1 = 1 1

11 Signed Numbers N bits represents 2 N values Unsigned integers Range [0, 2 N -1] How can negative values be indicated? Use a sign-bit Boolean indicator bit (flag)

12 Sign and Magnitude 16-bit numbers +1 (decimal) = 0000 0000 0000 0001 = 0x0001-1 (decimal) = 1000 0000 0000 0001 = 0x8001 Problems Two zeros 0x0000 0x8000 Complicated arithmetic Special steps needed to handle when signs are same or different (must check sign bit)

13 Ones Complement Complement the bits of a number +1 (decimal) = 0000 0000 0000 0001 = 0x0001-1 (decimal) = 1111 1111 1111 1110 = 0xFFFE Positive number have leading zeros Negative number have leading ones Arithmetic not too difficult Still have two zeros

14 Two s Complement Subtract large number from a smaller one Borrow from leading zeros Binary Result has leading ones 0011 3 0100 4 Unbalanced representation 1111-1 Leading zeros for positive 2 N-1 non-negatives Leading ones for negative number 2 N-1 negative number One zero representation First bit is sign-bit (must indicate width) Value = d 31-2 31 + d 30 2 30 + + d 1 2 1 + d 0 2 0 Negative value for sign bit Decimal

15 Two s Complement Negation Shortcut = invert bits and add 1 Number + complement = 0xF..F = -1 x + x = 1 x + 1 = x Example x 1111 1110 x 0000 0001 x + 1 0000 0010

16 Two s Complement Sign Extension Machine s have fixed width (e.g. 32-bits) Real numbers have infinite width (invisible extension) Positive has infinite 0 s Negative has infinite 1 s Replicate sign bit (msb) of smaller container to fill new bits in larger container Example 1111 1111 1111 1110 1111 1111 1111 1111 1111 1111 1111 1110

17 Overflow Fixed bit width limits number representation Occurs if result of arithmetic operation cannot be represented by hardware bits Example 8-bit: 127 + 127 Binary Decimal 0111 1111 127 0111 1111 127 1111 1110-2 (254)

18 Two s Complement Subtraction Subtraction (x y) can be performed by adding x and the two s complement of y Example 8-bit 29-27 Binary Decimal 0001 1101 29 0001 1011 27 1110 0100 27 1110 0101 27 + 1 = 27 0000 0010 2

19 Combinatorial Logic Circuits Combine logical variable inputs to produce a logic-variable output Logic can be specified by enumerating the output for all possible input combinations in a truth table Considered memoryless circuits The output at a given time instant are only dependent on the input at the same time instant

20 Inverter NOT operation inverts a logic variable We have seen this as complement already NOT(A) = A

21 AND Gate Logic gate computes the logical multiplication of input variables AND(A, B) = AB

22 OR Gate Logic gate computes the logical addition of input variables OR A, B = A + B

23 More Logic Gates In silicon chips, other gates are simpler to implement Buffer = NOT followed by NOT Returns the same value NAND = AND followed by NOT NOR = OR followed by NOT XOR is the exclusive-or gate XOR A, B = A B A B A B 0 0 0 0 1 1 1 0 1 1 1 0

24 Boolean Algebra Mathematical theory of logical variables Use basic AND, OR, and NOT relationships to prove a Boolean expression Can generate a truth table to specify the output relationship for all possible input values

25 De Morgan s Laws Provides a way to convert an AND relationship into an OR relationship and vice versa ABC = A + B + C A + B + C = A BC Implications: Any logic function can be implemented using AND gates and inverters Any logic function can be implemented using OR gates and inverters Only need either AND gates or OR gates (not both)

26 Implementation of Boolean Expressions A logical variable can be composed of Boolean relationships AND, OR, NOT, etc. Gate level implementation is straightforward Example F = ABC + ABC + (C + D)(D + E)

27 Simplifying Boolean Expression Find simpler equivalent expressions by manipulation of equation and Boolean relations Example F = ABC + ABC + (C + D)(D + E) F = ABC + ABC + CD + CE + DD + DE F = ABC + ABC + CD + CE + 0 + DE F = AC B + B + CD + CE + 0 + DE F = AC 1 + CD + CE + 0 + DE F = C A + D + E + DE

28 Comparison of Implementations F = ABC + ABC + (C + D)(D + E) F = C A + D + E + DE

29 Synthesis of Logic Require methods to convert logic circuit specifications into a practical gate level implementation Often the logic is specified in a natural language We will use truth tables to develop Boolean logic expressions that can be implemented with gates

30 Example Truth Table 3 Logical variable input and 1 output Enumerate all possible input values and specify the corresponding output A, B, C input and D output A B C D 0 0 0 1 0 0 1 0 0 1 0 1 0 1 1 0 1 0 0 0 1 0 1 0 1 1 0 1 1 1 1 1

31 Sum-of-Products Implementation Find all output rows that have a 1 output Determine AND relationship between inputs OR the AND terms from each row A B C D AND Term 0 0 0 1 A BC 0 0 1 0 0 1 0 1 A BC 0 1 1 0 1 0 0 0 1 0 1 0 1 1 0 1 ABC 1 1 1 1 ABC Can this be simplified? D = A BC + A BC + ABC + ABC

32 Product-of-Sums Implementation Find all output rows that have a 0 output Determine OR relationship between inputs AND the OR terms from each row A B C D OR Term 0 0 0 1 0 0 1 0 A + B + C 0 1 0 1 0 1 1 0 A + B + C 1 0 0 0 A + B + C 1 0 1 0 A + B + C 1 1 0 1 1 1 1 1 D = (A + B + C )(A + B + C )(A + B + C)(A + B + C )