Digital Fundamentals

Similar documents
Digital Fundamentals

CHW 261: Logic Design

Digital Fundamentals

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

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

Digital Fundamentals. CHAPTER 2 Number Systems, Operations, and Codes

MYcsvtu Notes DATA REPRESENTATION. Data Types. Complements. Fixed Point Representations. Floating Point Representations. Other Binary Codes

Lecture (02) Operations on numbering systems

Chapter 1. Digital Systems and Binary Numbers

Computer Organization

Chapter 3: Number Systems and Codes. Textbook: Petruzella, Frank D., Programmable Logic Controllers. McGraw Hill Companies Inc.

Review of Number Systems

Announcement. (CSC-3501) Lecture 3 (22 Jan 2008) Today, 1 st homework will be uploaded at our class website. Seung-Jong Park (Jay)

UNIT 7A Data Representation: Numbers and Text. Digital Data

Homework 1 graded and returned in class today. Solutions posted online. Request regrades by next class period. Question 10 treated as extra credit

Logic and Computer Design Fundamentals. Chapter 1 Digital Computers and Information

MACHINE LEVEL REPRESENTATION OF DATA

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

Chapter 2 Number Systems and Codes Dr. Xu

Binary Codes. Dr. Mudathir A. Fagiri

Binary Systems and Codes

Digital Systems and Binary Numbers

LOGIC DESIGN. Dr. Mahmoud Abo_elfetouh

CHAPTER TWO. Data Representation ( M.MORRIS MANO COMPUTER SYSTEM ARCHITECTURE THIRD EDITION ) IN THIS CHAPTER

Lecture (03) Binary Codes Registers and Logic Gates

CHAPTER 2 Data Representation in Computer Systems

CHAPTER 2 Data Representation in Computer Systems

Digital Logic. The Binary System is a way of writing numbers using only the digits 0 and 1. This is the method used by the (digital) computer.

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

Chap 1. Digital Computers and Information

DIGITAL SYSTEM DESIGN

Positional Number System

IT 1204 Section 2.0. Data Representation and Arithmetic. 2009, University of Colombo School of Computing 1

CS 121 Digital Logic Design. Chapter 1. Teacher Assistant. Hadeel Al-Ateeq

Chapter 4: Computer Codes. In this chapter you will learn about:

CHAPTER V NUMBER SYSTEMS AND ARITHMETIC

9/3/2015. Data Representation II. 2.4 Signed Integer Representation. 2.4 Signed Integer Representation

Digital Systems and Binary Numbers

Number Systems. Dr. Tarek A. Tutunji Philadelphia University, Jordan

Digital Systems and Binary Numbers

Logic Circuits I ECE 1411 Thursday 4:45pm-7:20pm. Nathan Pihlstrom.

Data Representation and Binary Arithmetic. Lecture 2

Introduction to Computer Science-103. Midterm

Objectives. Connecting with Computer Science 2

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

The Gray Code. Script

SE311: Design of Digital Systems

A Level Computing. Contents. For the Exam:

Number Systems. Both numbers are positive

Final Labs and Tutors

Data Representation 1

Korea University of Technology and Education

Number Systems Prof. Indranil Sen Gupta Dept. of Computer Science & Engg. Indian Institute of Technology Kharagpur Number Representation

Chapter 2. Data Representation in Computer Systems

ENEE x Digital Logic Design. Lecture 3

Chapter 2. Data Representation in Computer Systems. Objectives (1 of 2) Objectives (2 of 2)

Lecture 2: Number Systems

Chapter 2. Data Representation in Computer Systems

Digital Computers and Machine Representation of Data

The type of all data used in a C++ program must be specified

Computer Organization

Basic data types. Building blocks of computation

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

CMPS 10 Introduction to Computer Science Lecture Notes

Electronic Data and Instructions

The type of all data used in a C (or C++) program must be specified

10.1. Unit 10. Signed Representation Systems Binary Arithmetic

Chapter 1 Review of Number Systems

umber Systems bit nibble byte word binary decimal

Chapter 10 Error Detection and Correction 10.1

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

CHAPTER 2 (b) : AND CODES

Beyond Base 10: Non-decimal Based Number Systems

Chapter 2 Data Representations

Binary Addition & Subtraction. Unsigned and Sign & Magnitude numbers

Ms Sandhya Rani Dash UNIT 2: NUMBER SYSTEM AND CODES. 1.1 Introduction

IBM 370 Basic Data Types

Number Systems CHAPTER Positional Number Systems

Number System. Introduction. Decimal Numbers

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

CS101 Lecture 04: Binary Arithmetic

Data Representations & Arithmetic Operations

COMP Overview of Tutorial #2

LING 388: Computers and Language. Lecture 5

M1 Computers and Data

CS/EE1012 INTRODUCTION TO COMPUTER ENGINEERING SPRING 2013 HOMEWORK I. Solve all homework and exam problems as shown in class and sample solutions

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

ECE 20B, Winter Purpose of Course. Introduction to Electrical Engineering, II. Administration

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

Course Schedule. CS 221 Computer Architecture. Week 3: Plan. I. Hexadecimals and Character Representations. Hexadecimal Representation

Number codes nibble byte word double word

DATA REPRESENTATION. Data Types. Complements. Fixed Point Representations. Floating Point Representations. Other Binary Codes. Error Detection Codes

Thus needs to be a consistent method of representing negative numbers in binary computer arithmetic operations.

a- As a special case, if there is only one symbol, no bits are required to specify it.

Representing Information. Bit Juggling. - Representing information using bits - Number representations. - Some other bits - Chapters 1 and 2.3,2.

EEM 232 Digital System I

Beyond Base 10: Non-decimal Based Number Systems

Computer Science 324 Computer Architecture Mount Holyoke College Fall Topic Notes: Bits and Bytes and Numbers

Introduction to Computers and Programming. Numeric Values

Programming Concepts and Skills. ASCII and other codes

Transcription:

Digital Fundamentals Tenth Edition Floyd Chapter 2 2009 Pearson Education, Upper 2008 Pearson Saddle River, Education NJ 07458. All Rights Reserved

Quiz 2 Agenda Lecture: Chapter 2 (2-7 through 2-11): pp. 62-90 Lab 2, Experiment 3B: Number Systems Steps 5, 6, & Further Investigation (pg 23) in Buchla Section of Supplemental Text. Assignment: Questions 30, 32, 36, 38, 40, 42, 44, 48, 50, 52, & 58 from the Problems section on pp. 96-98. Prepare for Exam 1 on Units 1, 2, & 3.

Arithmetic Operations with Signed Numbers Using the signed number notation with negative numbers in 2 s complement form simplifies addition and subtraction of signed numbers. Rules for addition: Add the two signed numbers. Discard any final carries. The result is in signed form. Examples: 00011110 = +30 00001111 = +15 00101101 = +45 00001110 = +14 11101111 = -17 11111101 = -3 Discard carry 11111111 = -1 11111000 = -8 111110111 = -9

Arithmetic Operations with Signed Numbers Note that if the number of bits required for the answer is exceeded, overflow will occur. This occurs only if both numbers have the same sign. The overflow will be indicated by an incorrect sign bit. Two examples are: 01000000 = +128 01000001 = +129 10000001 = -126 Discard carry 10000001 = -127 10000001 = -127 100000010 = +2 Wrong! The answer is incorrect and the sign bit has changed.

Arithmetic Operations with Signed Numbers Rules for subtraction: 2 s complement the subtrahend and add the numbers. Discard any final carries. The result is in signed form. Repeat the examples done previously, but subtract: 00011110-00001111 (+30) (+15) 2 s complement subtrahend and add: 00011110 = +30 11110001 = -15 100001111 = +15 00001110 11101111 (+14) (-17) 11111111 - - 11111000 00001110 = +14 00010001 = +17 00011111 = +31 (-1) (-8) 11111111 = -1 00001000 = +8 100000111 = +7 Discard carry Discard carry

Hexadecimal Numbers Hexadecimal uses sixteen characters to represent numbers: the numbers 0 through 9 and the alphabetic characters A through F. Large binary number can easily be converted to hexadecimal by grouping bits 4 at a time and writing the equivalent hexadecimal character. Express 1001 0110 0000 1110 2 in hexadecimal: Group the binary number by 4-bits starting from the right. Thus, 960E Decimal Hexadecimal Binary 0 1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 0 1 2 3 4 5 6 7 8 9 A B C D E F 0000 0001 0010 0011 0100 0101 0110 0111 1000 1001 1010 1011 1100 1101 1110 1111

Hexadecimal Numbers Hexadecimal is a weighted number system. The column weights are powers of 16, which increase from right to left. Column weights { 16 3 16 2 16 1 16 0. 4096 256 16 1. Express 1A2F 16 in decimal. Start by writing the column weights: 4096 256 16 1 1 A 2 F 16 1(4096) + 10(256) +2(16) +15(1) = 6703 10 Decimal Hexadecimal Binary 0 1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 0 1 2 3 4 5 6 7 8 9 A B C D E F 0000 0001 0010 0011 0100 0101 0110 0111 1000 1001 1010 1011 1100 1101 1110 1111

Octal Numbers Octal uses eight characters the numbers 0 through 7 to represent numbers. There is no 8 or 9 character in octal. Binary number can easily be converted to octal by grouping bits 3 at a time and writing the equivalent octal character for each group. Express 1 001 011 000 001 110 2 in octal: Group the binary number by 3-bits starting from the right. Thus, 113016 8 Decimal Octal Binary 0 1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 0 1 2 3 4 5 6 7 10 11 12 13 14 15 16 17 0000 0001 0010 0011 0100 0101 0110 0111 1000 1001 1010 1011 1100 1101 1110 1111

Octal Numbers Octal is also a weighted number system. The column weights are powers of 8, which increase from right to left. Column weights { 8 3 8 2 8 1 8 0. 512 64 8 1. Express 3702 8 in decimal. Start by writing the column weights: 512 64 8 1 3 7 0 2 8 3(512) + 7(64) +0(8) +2(1) = 1986 10 Decimal Octal Binary 0 1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 0 1 2 3 4 5 6 7 10 11 12 13 14 15 16 17 0000 0001 0010 0011 0100 0101 0110 0111 1000 1001 1010 1011 1100 1101 1110 1111

BCD Binary coded decimal (BCD) is a weighted code that is commonly used in digital systems when it is necessary to show decimal numbers such as in clock displays. The table illustrates the difference between straight binary and BCD. BCD represents each decimal digit with a 4-bit code. Notice that the codes 1010 through 1111 are not used in BCD. Decimal Binary BCD 0 1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 0000 0001 0010 0011 0100 0101 0110 0111 1000 1001 1010 1011 1100 1101 1110 1111 0000 0001 0010 0011 0100 0101 0110 0111 1000 1001 00010000 0001 0001 00010010 00010011 00010100 00010101

BCD You can think of BCD in terms of column weights in groups of four bits. For an 8-bit BCD number, the column weights are: 80 40 20 10 8 4 2 1. What are the column weights for the BCD number 1000 0011 0101 1001? 8000 4000 2000 1000 800 400 200 100 80 40 20 10 8 4 2 1 Note that you could add the column weights where there is a 1 to obtain the decimal number. For this case: 8000 + 200 +100 + 40 + 10 + 8 +1 = 8359 10

BCD A lab experiment in which BCD is converted to decimal is shown. Summary

Gray code Gray code is an unweighted code that has a single bit change between one code word and the next in a sequence. Gray code is used to avoid problems in systems where an error can occur if more than one bit changes at a time. Decimal Binary Gray code 0 1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 0000 0001 0010 0011 0100 0101 0110 0111 1000 1001 1010 1011 1100 1101 1110 1111 0000 0001 0011 0010 0110 0111 0101 0100 1100 1101 1111 1110 1010 1011 1001 1000

Gray code Summary A shaft encoder is a typical application. Three IR emitter/detectors are used to encode the position of the shaft. The encoder on the left uses binary and can have three bits change together, creating a potential error. The encoder on the right uses gray code and only 1-bit changes, eliminating potential errors. Binary sequence Gray code sequence

ASCII ASCII is a code for alphanumeric characters and control characters. In its original form, ASCII encoded 128 characters and symbols using 7-bits. The first 32 characters are control characters, that are based on obsolete teletype requirements, so these characters are generally assigned to other functions in modern usage. In 1981, IBM introduced extended ASCII, which is an 8- bit code and increased the character set to 256. Other extended sets (such as Unicode) have been introduced to handle characters in languages other than English.

Parity Method Summary The parity method is a method of error detection for simple transmission errors involving one bit (or an odd number of bits). A parity bit is an extra bit attached to a group of bits to force the number of 1 s to be either even (even parity) or odd (odd parity). The ASCII character for a is 1100001 and for A is 1000001. What is the correct bit to append to make both of these have odd parity? The ASCII a has an odd number of bits that are equal to 1; therefore the parity bit is 0. The ASCII A has an even number of bits that are equal to 1; therefore the parity bit is 1.

Cyclic Redundancy Check Summary The cyclic redundancy check (CRC) is an error detection method that can detect multiple errors in larger blocks of data. At the sending end, a checksum is appended to a block of data. At the receiving end, the check sum is generated and compared to the sent checksum. If the check sums are the same, no error is detected.

Selected Key Terms Byte Floating-point number Hexadecimal Octal BCD A group of eight bits A number representation based on scientific notation in which the number consists of an exponent and a mantissa. A number system with a base of 16. A number system with a base of 8. Binary coded decimal; a digital code in which each of the decimal digits, 0 through 9, is represented by a group of four bits.

Selected Key Terms Alphanumeric ASCII Parity Cyclic redundancy check (CRC) Consisting of numerals, letters, and other characters American Standard Code for Information Interchange; the most widely used alphanumeric code. In relation to binary codes, the condition of evenness or oddness in the number of 1s in a code group. A type of error detection code.

Quiz 2 Agenda Lecture: Chapter 2 (2-7 through 2-11): pp. 62-90 Lab 2, Experiment 3B: Number Systems Steps 5, 6, & Further Investigation (pg 23) in Buchla Section of Supplemental Text. Assignment: Questions 30, 32, 36, 38, 40, 42, 44, 48, 50, 52, & 58 from the Problems section on pp. 96-98. Prepare for Exam 1 on Units 1, 2, & 3.