ECE 2110: Introduction to Digital Systems

Slides:



Advertisements
Similar presentations
COE 202: Digital Logic Design Signed Numbers
Advertisements

Binary Representation
Assembly Language and Computer Architecture Using C++ and Java
Number Systems Decimal (Base 10) Binary (Base 2) Hexadecimal (Base 16)
Sistemas Digitais I LESI - 2º ano Lesson 2 - Number Systems U NIVERSIDADE DO M INHO E SCOLA DE E NGENHARIA Prof. João Miguel Fernandes
1 Binary Arithmetic, Subtraction The rules for binary arithmetic are: = 0, carry = = 1, carry = = 1, carry = = 0, carry =
CSCE 211: Digital Logic Design Chin-Tser Huang University of South Carolina.
Assembly Language for Intel-Based Computers, 5 th Edition Chapter 1: Basic Concepts (c) Pearson Education, All rights reserved. You may modify.
VIT UNIVERSITY1 ECE 103 DIGITAL LOGIC DESIGN CHAPTER I NUMBER SYSTEMS AND CODES Reference: M. Morris Mano & Michael D. Ciletti, "Digital Design", Fourth.
DIGITAL SYSTEMS TCE1111 Representation and Arithmetic Operations with Signed Numbers Week 6 and 7 (Lecture 1 of 2)
S. Barua – CPSC 240 CHAPTER 2 BITS, DATA TYPES, & OPERATIONS Topics to be covered are Number systems.
1 Binary Numbers Again Recall that N binary digits (N bits) can represent unsigned integers from 0 to 2 N bits = 0 to 15 8 bits = 0 to bits.
Arithmetic Operations and Circuits Lecture 5. Binary Arithmetic let’s look at the procedures for performing the four basic arithmetic functions: addition,
1 Lecture 2: Number Systems Binary numbers Base conversion Arithmetic Number systems  Sign and magnitude  Ones-complement  Twos-complement Binary-coded.
ECE 2110: Introduction to Digital Systems Signed Number Conversions.
ES 244: Digital Logic Design Chapter 1 Chapter 1: Introduction Uchechukwu Ofoegbu Temple University.
ACOE1611 Data Representation and Numbering Systems Dr. Costas Kyriacou and Dr. Konstantinos Tatas.
ECE 3110: Introduction to Digital Systems Course Review.
Computers Organization & Assembly Language
CSU0014 Assembly Languages Homepage: Textbook: Kip R. Irvine, Assembly Language for Intel-Based Computers,
Summer 2014 Chapter 1: Basic Concepts. Irvine, Kip R. Assembly Language for Intel-Based Computers 6/e, Chapter Overview Welcome to Assembly Language.
Assembly Language for x86 Processors 7th Edition
#1 Lec # 2 Winter EECC341 - Shaaban Positional Number Systems A number system consists of an order set of symbols (digits) with relations.
ECE 3110: Introduction to Digital Systems Review #1 (Chapter 1,2)
1 Digital Systems and Binary Numbers EE 208 – Logic Design Chapter 1 Sohaib Majzoub.
Lec 3: Data Representation Computer Organization & Assembly Language Programming.
Chapter 2 Number Systems + Codes. Overview Objective: To use positional number systems To convert decimals to binary integers To convert binary integers.
CHAPTER 1 INTRODUCTION NUMBER SYSTEMS AND CONVERSION.
Number Systems. Why binary numbers? Digital systems process information in binary form. That is using 0s and 1s (LOW and HIGH, 0v and 5v). Digital designer.
1 Digital Design: Number Systems Credits : Slides adapted from: J.F. Wakerly, Digital Design, 4/e, Prentice Hall, 2006 C.H. Roth, Fundamentals of Logic.
Number Systems Decimal (Base 10) –10 digits (0,1,2,3,4,5,6,7,8,9) Binary (Base 2) –2 digits (0,1) Digits are often called bits (binary digits) Hexadecimal.
ECE 3110: Introduction to Digital Systems Number Systems.
CHAPTER 1 INTRODUCTION NUMBER SYSTEMS AND CONVERSION
Lecture 4 Last Lecture –Positional Numbering Systems –Converting Between Bases Today’s Topics –Signed Integer Representation Signed magnitude One’s complement.
Number Systems ELEC 311 Digital Logic and Circuits Dr. Ron Hayne Images Courtesy of Cengage Learning.
ECE 3110: Introduction to Digital Systems BCD, Gray, Character, Action/Event, Serial Data.
Computer Arithmetic and the Arithmetic Unit Lesson 2 - Ioan Despi.
CPU Internal memory I/O interface circuit System bus
1 EENG 2710 Chapter 1 Number Systems and Codes. 2 Chapter 1 Homework 1.1c, 1.2c, 1.3c, 1.4e, 1.5e, 1.6c, 1.7e, 1.8a, 1.9a, 1.10b, 1.13a, 1.19.
ECE 301 – Digital Electronics Unsigned and Signed Numbers, Binary Arithmetic of Signed Numbers, and Binary Codes (Lecture #2)
ECE 2110: Introduction to Digital Systems BCD, Gray, Character, Action/Event, Serial Data.
Dr. Ahmed Telba EE208: Logic Design Lecture# 1 Introduction & Number Systems.
BR 8/99 Binary Numbers Again Recall than N binary digits (N bits) can represent unsigned integers from 0 to 2 N bits = 0 to 15 8 bits = 0 to 255.
ECE 3110: Introduction to Digital Systems unsigned Multiplication/Division codes.
Number Systems Decimal (Base 10) –10 digits (0,1,2,3,4,5,6,7,8,9) Binary (Base 2) –2 digits (0,1) Digits are often called bits (binary digits) Hexadecimal.
ECE 2110: Introduction to Digital Systems 2. Number Systems & Codes.
ECE 2110: Introduction to Digital Systems Signed Addition/Subtraction.
ECE 2110: Introduction to Digital Systems Course Review.
Chapter 19 Number Systems. Irvine, Kip R. Assembly Language for Intel-Based Computers, Translating Languages English: Display the sum of A times.
ECE 3110: Introduction to Digital Systems Introduction (Contd.)
ECE 2110: Introduction to Digital Systems Introduction (Contd.)
AEEE2031 Data Representation and Numbering Systems.
ECE 2110: Introduction to Digital Systems
Digital Design Basics Analog vs Digital Why we need digital? Reproducibility, economy, programmability… Digital Devices Gates, FFs Combinational, sequential.
Orange Coast College Business Division Computer Science Department CS 116- Computer Architecture Logic Design: Part 1.
ECE 3110: Introduction to Digital Systems Number Systems.
ECE 2110: Introduction to Digital Systems Number Systems.
ECE 2110: Introduction to Digital Systems Number Systems: conversions.
ECE 3110: Introduction to Digital Systems Signed Number Conversions and operations.
CHAPTER 3 BINARY NUMBER SYSTEM. Computers are electronic machines which operate using binary logic. These devices use two different values to represent.
Number Systems. The position of each digit in a weighted number system is assigned a weight based on the base or radix of the system. The radix of decimal.
ECE 2110: Introduction to Digital Systems Number Systems: conversions.
ECE 2110: Introduction to Digital Systems Introduction (Contd.)
Number Systems Decimal (Base 10) –10 digits (0,1,2,3,4,5,6,7,8,9) Binary (Base 2) –2 digits (0,1) Digits are often called bits (binary digits) Hexadecimal.
ECE 2110: Introduction to Digital Systems Signed Number Conversions.
Unit 1 Introduction Number Systems and Conversion.
ECE 2110: Introduction to Digital Systems
CHAPTER 1 INTRODUCTION NUMBER SYSTEMS AND CONVERSION
CHAPTER 1 : INTRODUCTION
ECE 3110: Introduction to Digital Systems
Presentation transcript:

ECE 2110: Introduction to Digital Systems Review #1 (Chapter 1 ,2)

Chapters 1,2 summary Analog<-->Digital: advantages, electronic aspects, software aspects, digital design levels. IC: wafer, die, classifications (SSI,MSI,LSI,VLSI) Positional number systems: binary, octal, decimal, hex Unsigned numbers: conversions, addition/subtraction Signed numbers: representations, conversions, addition/subtraction Sign extension Overflow (in 2’s complement operations) Binary Codes for decimal numbers: BCD (8421) ,2421, 6311,…. Gray code Other codes (7-bit ASCII)

Digital Design Basics Analog vs. Digital Why we need digital? Reproducibility, economy, programmability… Digital Devices Gates, FFs Combinational: output depends only on the current input combination Sequential circuits: output depends on current input as well as past inputs. Has memory of past events.

Electronic and software aspect of digital design Digital abstraction Noise Margin specification Examples of software tools

Integrated Circuits (IC) A collection of one or more gates fabricated on a single silicon chip. Wafer, die Small-scale integration (SSI): 1-20 DIP: dual in-line-pin package Pin diagram, pinout MSI: 20-200 gates LSI: 200-200,000 VLSI: >100,000. Reached 50million in 1999

Digital Design Levels Many representations of digital logic Device Physics and IC manufacturing Moore’s Law [1965, Gordon Moore]: Transistor level --->Logic design, functional building blocks Transistor level, Truth table, gate level logic, prepackaged blocks, equations, HDL

Binary Representation The basis of all digital data is binary representation. Binary - means ‘two’ 1, 0 True, False Hot, Cold On, Off We must be able to handle more than just values for real world problems 1, 0, 56 True, False, Maybe Hot, Cold, Warm, Cool On, Off, Leaky

Positional Notation Base Radix Weight Radix 2, 8, 10,16

Unsigned numbers Conversions: N binary digits (N bits) can represent unsigned integers from 0 to 2N-1. Conversions: Hex <----->binary Octal <-----> binary (padded with zero) Any base <----->decimal Operations (binary): addition, subtraction, multiplication,…

Hex to Binary, Binary to Hex A2F16 = 1010 0010 11112 34516 = 0011 0100 01012 Binary to Hex is just the opposite, create groups of 4 bits starting with least significant bits. If last group does not have 4 bits, then pad with zeros for unsigned numbers. 10100012 = 0101 00012 = 5116 Padded with a zero

Conversion of Any Base to Decimal Converting from ANY base to decimal is done by multiplying each digit by its weight and summing. Binary to Decimal 1011.112 = 1x23 + 0x22 + 1x21 + 1x20 + 1x2-1 + 1x2-2 = 8 + 0 + 2 + 1 + 0.5 + 0.25 = 11.75 Hex to Decimal A2F16 = 10x162 + 2x161 + 15x160 = 10 x 256 + 2 x 16 + 15 x 1 = 2560 + 32 + 15 = 2607

Conversion of Decimal Integer To ANY Base Divide Number N by base R until quotient is 0. Remainder at EACH step is a digit in base R, from Least Significant digit to Most significant digit.

Conversion of Decimal Integer To ANY Base Example Convert 53 to binary (R=2) 53/2 = 26, rem = 1 26/2 = 13, rem = 0 13/2 = 6 , rem = 1 6 /2 = 3, rem = 0 3/2 = 1, rem = 1 1/2 = 0, rem = 1 Check 5310 = 1101012 = 1x25 + 1x24 + 0x23 + 1x22 + 0x21 + 1x20 = 32 + 16 + 0 + 4 + 0 + 1 = 53 √ Least Significant Digit Most Significant Digit

Binary addition/subtraction rules cin or bin X Y Cout s Bout d 1

Binary, Decimal addition 1010112 + 0000012 --------------- 1011002 From LSB to MSB: 1+1 = 0, carry of 1 1 (carry)+1+0 = 0, carry of 1 1 (carry)+0 + 0 = 1, no carry 1 +0 = 1 0 + 0 = 0 1 + 0 = 1 answer = 1011002 34 + 17 ------ 51 from LSD to MSD: 7+4 = 1; with carry out of 1 to next column 1 (carry) + 3 + 1 = 5. answer = 51.

Subtraction Binary Decimal 900 1002 - 001 ------- 899 0-1 = 9; with borrow of 1 from next column 0 -1 (borrow) - 0 = 9, with borrow of 1 9 - 1 (borrow) - 0 = 8. Answer = 899. 1002 - 0012 ------- 0112 0-1 = 1; with borrow of 1 from next column 0 -1 (borrow) - 0 = 1, with borrow of 1 1 - 1 (borrow) - 0 = 0. Answer = 0112.

Representation of Negative Numbers Signed-Magnitude Representation: Negates a number by changing its sign. Complement Number Systems: negates a number by taking its complement. Diminished Radix-Complement Representation One’s-Complement Radix-Complement Representation Two’s-Complement

NOTE: Fix number of digits SM, 1’s complement, 2’s complement may be different for NEGATIVE numbers, but for positive numbers, the representations in SM, 1’s complement, 2’s complement are the SAME, equals to the unsigned binary representation.

Ranges (N bits) unsigned binary can represent unsigned integers from 0 to 2N-1. SM can represent the signed integers -(2(N-1) - 1) to + (2(N-1) - 1 ) 1’s complement can represent the signed integers -(2(N-1) - 1) to + (2(N-1) - 1 ) 2’s complement can represent the signed integers -2(N-1) to + (2(N-1) - 1)

Sign extension For unsigned binary, Just add zeros to the left. For signed binary (SM,1’s,2’s complement…): Take whatever the SIGN BIT is, and extend it to the left.

Conversions for signed numbers Hex--->signed decimal Given a Hex number, and you are told to convert to a signed integer (either as signed magnitude, 1s complement, 2s complement) Step 1: Determine the sign Step 2: determine magnitude Step 3: combine sign and magnitude Signed decimal ---->hex Step 1: Know what format you are converting to!!! Step 2: Ignore the sign, convert the magnitude of the number to binary. Step 3 (positive decimal number): If the decimal number was positive, then you are finished no matter what the format is! Step 3 (negative decimal number): more work need to do.

Hex to Signed Decimal Conversion Rules STEP 1: Determine the sign! If the Most Significant Bit is zero, the sign is positive. If the MSB is one, the sign is negative. This is true for ALL THREE representations: SM, 1s complement, 2s complement. STEP 2 (positive sign): If the sign is POSITIVE, then just convert the hex value to decimal. The representation is the same for SM, 1s complement, 2s complement. STEP 2 (negative sign): If the sign is Negative, then need to compute the magnitude of the number. If the number is SM format, set Sign bit to Zero If the number is 1s complement, complement each bit. If the number is 2s complement, complement and add one. STEP 3 : Just combine the sign and magnitude to get the result.

Signed Decimal to Hex conversion Step 1: Know what format you are converting to!!! You must know if you are converting the signed decimal to SM, 1s complement, or 2s complement. Step 2: Ignore the sign, convert the magnitude of the number to binary. Step 3 (positive decimal number): If the decimal number was positive, then you are finished no matter what the format is! Step 3 (negative decimal number): Need to do more if decimal number was negative. If converting to SM format, set Sign bit to One: If converting to 1s complement, complement each bit. If converting to 2s complement, complement each bit and add 1.

signed addition/subtraction Two’s-complement Addition rules Subtraction rules Overflow: Out of range Detecting unsigned overflow (carry out of MSB) Detecting 2’s complement overflow

Detecting Two’s Complement Overflow Two’s complement overflow occurs is: Add two POSITIVE numbers and get a NEGATIVE result Add two NEGATIVE numbers and get a POSITIVE result We CANNOT get two’s complement overflow if I add a NEGATIVE and a POSITIVE number together. The Carry out of the Most Significant Bit means nothing if the numbers are two’s complement numbers.

Codes Code: A set of n-bit strings in which different bit strings represent different numbers or other things. Code word: a particular combination of n-bit values N-bit strings at most contain 2n valid code words. To represent 10 decimal digits, at least need 4 bits. Excessive ways to choose ten 4-bit words. Some common codes: BCD: Binary-coded decimal, also known as 8421 code Excess-3 2421… Codes can be used to represent numerical numbers, nonnumeric texts, events/actions/states/conditions

How to construct Gray Code Recursively A 1-bit Gray Code has 2 code words, 0, 1 The first 2n code words of an (n+1)-bit Gray code equal the code words of an n-bit Gray Code, written in order with a leading 0 appended. The last 2n code words equal the code words of an n-bit Gray Code, but written in reverse order with a leading 1 appended.

Another method to construct Gray Code The bits of an n-bit binary or Gray-code word are numbered from right to left, from 0 to n-1 Bit i of a Gray code word is 0 if bits i and i+1 of the corresponding binary code words are the same 1: otherwise