George W. Woodruff School of Mechanical Engineering, Georgia Tech ME4447/6405 ME 4447/6405 Microprocessor Control of Manufacturing Systems and Introduction.

Slides:



Advertisements
Similar presentations
Representing Numbers: Integers
Advertisements

HEXADECIMAL NUMBERS Code
Company LOGO Edit your slogan here DKT 122/3 DIGITAL SYSTEM 1 WEEK #3 NUMBER SYSTEMS, OPERATION & CODES (PART 2)
Number Systems & Operations
Chapter 1 Binary Systems 1-1. Digital Systems
Number Systems Standard positional representation of numbers:
Assembly Language and Computer Architecture Using C++ and Java
DIGITAL SYSTEMS TCE1111 Representation and Arithmetic Operations with Signed Numbers Week 6 and 7 (Lecture 1 of 2)
IT Systems Number Operations EN230-1 Justin Champion C208 –
Signed Numbers CS208. Signed Numbers Until now we've been concentrating on unsigned numbers. In real life we also need to be able represent signed numbers.
Number Systems & Logic Gates Day 2. Octal Number System Base (Radix)8 Digits0, 1, 2, 3, 4, 5, 6, 7 e.g = =648 1 =88 0 =1 The digit.
Data Representation – Chapter 3 Sections 3-2, 3-3, 3-4.
Mantıksal Tasarım – BBM231 M. Önder Efe
1 Lecture 2: Number Systems Binary numbers Base conversion Arithmetic Number systems  Sign and magnitude  Ones-complement  Twos-complement Binary-coded.
Data Representation in Computers. Data Representation in Computers/Session 3 / 2 of 33 Number systems  The additive approach – Number earlier consisted.
Dr. Bernard Chen Ph.D. University of Central Arkansas
Simple Data Type Representation and conversion of numbers
ES 244: Digital Logic Design Chapter 1 Chapter 1: Introduction Uchechukwu Ofoegbu Temple University.
Computers Organization & Assembly Language
Computer Arithmetic Nizamettin AYDIN
IT253: Computer Organization
Number Systems. Today Decimal Hexadecimal Binary –Unsigned Binary –1’s Complement Binary –2’s Complement Binary.
Engineering 1040: Mechanisms & Electric Circuits Spring 2014 Number Systems.
1 DLD Lecture 18 Recap. 2 Recap °Number System/Inter-conversion, Complements °Boolean Algebra °More Logic Functions: NAND, NOR, XOR °Minimization with.
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.
Number systems, Operations, and Codes
ECE2030 Introduction to Computer Engineering Lecture 2: Number System Prof. Hsien-Hsin Sean Lee School of Electrical and Computer Engineering Georgia Tech.
1 IT 231, CMPE 331 Digital Logic Design Week 2 Number systems and arithmetic.
Microcomputers I - Electrical and Computer Engineering Dept. at Kettering.
Number Systems Binary to Decimal Octal to Decimal Hexadecimal to Decimal Binary to Octal Binary to Hexadecimal Two’s Complement.
Computer Math CPS120 Introduction to Computer Science Lecture 4.
AEEE2031 Data Representation and Numbering Systems.
Kavita Bala CS 3410, Spring 2014 Computer Science Cornell University.
Introduction to Microprocessors Chapter 2. Decimal or Base 10 Numbers  Have ten different digits (0-9)  It is a weighted number system. Each position.
1 Understand the examples again Overflow –When two positive numbers added together or a negative number subtracted from a positive number yields negative.
George W. Woodruff School of Mechanical Engineering, Georgia Tech ME4447/6405 ME 4447/6405 Microprocessor Control of Manufacturing Systems and Introduction.
Number Systems by Dr. Amin Danial Asham. References  Programmable Controllers- Theory and Implementation, 2nd Edition, L.A. Bryan and E.A. Bryan.
Introduction * Binary numbers are represented with a separate sign bit along with the magnitude. * For example, in an 8-bit binary number, the MSB is.
Introduction To Number Systems Binary System M. AL-Towaileb1.
Introduction to Digital Electronics Lecture 2: Number Systems.
CSC 331: DIGITAL LOGIC DESIGN COURSE LECTURER: E. Y. BAAGYERE. CONTACT: LECTURE TIME: 15:40 – 17:45 hrs. VENUE: SP-LAB.
In decimal we are quite familiar with placing a “-” sign in front of a number to denote that it is negative The same is true for binary numbers a computer.
Lecture No. 4 Computer Logic Design. Negative Number Representation 3 Options –Sign-magnitude –One’s Complement –Two’s Complement  used in computers.
President UniversityErwin SitompulDigital Systems 7/1 Lecture 7 Digital Systems Dr.-Ing. Erwin Sitompul President University
1’S COMPLEMENT REPRESENTATION 1’s complement of a number (binary) is obtained by changing all 1’s to 0 and all 0’s to 1. If one of these numbers is positive.
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.
Digital logic COMP214  Lecture 2 Dr. Sarah M.Eljack Chapter 1 1.
Binary Values. Numbers Natural Numbers Zero and any number obtained by repeatedly adding one to it. Examples: 100, 0, 45645, 32 Negative Numbers.
Prepared By: Norakmar Binti Mohd Nadzari CHAPTER 2 ARITHMETIC AND LOGIC UNIT.
Chapter 4 Operations on Bits.
Negative Binary Numbers
Digital Logic & Design Dr. Waseem Ikram Lecture 02.
Negative Binary Numbers
CSE 102 Introduction to Computer Engineering
University of Gujrat Department of Computer Science
ELL100: INTRODUCTION TO ELECTRICAL ENGG.
Digital Logic & Design Lecture 02.
ME 4447/6405 Microprocessor Control of Manufacturing Systems and
Data Representation – Chapter 3
Digital Logic Design (ECEg3141) 2. Number systems, operations & codes 1.
1.6) Storing Integer:.
Digital Electronics and Microprocessors
Unit 18: Computational Thinking
ME 4447/6405 Microprocessor Control of Manufacturing Systems and
2’s Complement form 1’s complement form 2’s complement form
Introduction To Number Systems
COE 202: Digital Logic Design Number Systems Part 2
Presentation transcript:

George W. Woodruff School of Mechanical Engineering, Georgia Tech ME4447/6405 ME 4447/6405 Microprocessor Control of Manufacturing Systems and Introduction to Mechatronics Instructor: Professor Charles Ume Lecture #6

George W. Woodruff School of Mechanical Engineering, Georgia Tech ME4447/6405

ME4447/6405 Hexadecimal – Base ABCDEF A1B1C1D1E1F A2B2C2D2E2F30

George W. Woodruff School of Mechanical Engineering, Georgia Tech ME4447/6405 Octal – Base

George W. Woodruff School of Mechanical Engineering, Georgia Tech ME4447/6405 Conversion from base 10  base 16  base 2 and back  base 10 Example 1: Read Remainders backwards Therefore, = 2A2 16 = Remainder 2 Remainder A Remainder 2 Read

George W. Woodruff School of Mechanical Engineering, Georgia Tech ME4447/6405 Example 1 Cont’d 2A2 16 to base 10: = 2 x A x x 16 2 = to base 10: =0 x x x x x x x x x x x x 2 11 =674 10

George W. Woodruff School of Mechanical Engineering, Georgia Tech ME4447/6405 Conversion from base 10 to 2 This method known as “repeated division by 2.” Example 2: Convert to base 2. Remainder 1 Remainder 0 Remainder 1 Remainder 0 Remainder 1 Read Stop dividing when the answer is 0. The remainders are read in reverse order to form the answer. Therefore, = = (Note: 2 front bits added for 8-bit processor)

George W. Woodruff School of Mechanical Engineering, Georgia Tech ME4447/6405 Example 2 Cont’d Note: = 7 x x 10 1 = = 37 Therefore, = 1 x x x x x x x x 2 7 = = 37 10

George W. Woodruff School of Mechanical Engineering, Georgia Tech ME4447/6405 Example 3 Convert to the decimal system Solution: = (1 x 2 -3 ) + (1 x 2 -2 ) + (1 x 2 -1 ) + (0 x 2 0 ) + (1 x 2 1 ) + (1 x 2 2 ) = =

George W. Woodruff School of Mechanical Engineering, Georgia Tech ME4447/6405 Example 4 Convert 2A to the decimal system Solution: 2A2.5 = (5 x ) + (2 x 16 0 ) + (A x 16 1 ) + (2 x 16 2 ) = =

George W. Woodruff School of Mechanical Engineering, Georgia Tech ME4447/6405 Example 5 Convert to Binary Solution: 0.75 x 2 = 1.50  x 2 = 1.00  1 Therefore, = Read

George W. Woodruff School of Mechanical Engineering, Georgia Tech ME4447/6405 Example 6 Convert to Binary Solution: x 2 =  x 2 =  x 2 =  x 2 =  0 Therefore, = …… Read

George W. Woodruff School of Mechanical Engineering, Georgia Tech ME4447/6405 The circuitry required for computers to add binary numbers is relatively simple. However, since circuitry to subtract binary numbers is very difficult to design and build, another subtraction method would be desirable. The method is subtraction by addition of the 1’s or 2’s complements of the number. Subtraction by the addition of 1’s complement requires much more hardware to implement. Most computers on the market perform subtraction by the addition of 2’s complement. Therefore we will concentrate only on subtraction by 2’s complement. Binary number= ’s complement= ’s complement= When subtraction is performed the answer can be positive or negative, depending upon the relative values of the minuend and subtrahend. We must, therefore, in some way account for the sign of the answer.

George W. Woodruff School of Mechanical Engineering, Georgia Tech ME4447/6405 The most significant bit (MSB) is used as the sign bit. If the MSB is a ‘1’, the number represented by the remaining 7 bits is assumed to be negative and is represented by its 2’s complement. If the MSB is a ‘0’, the number represented in the remaining seven bits is positive and is equal to the binary equivalent of these seven bits. Example 1:17 10 – 6 10 =(11 16 – 6 16 ) = = 1’s complement of = 2’s complement of = = 6 16 in 2’s complement = + 0B 16 =

George W. Woodruff School of Mechanical Engineering, Georgia Tech ME4447/6405 Example 2:6 10 – = (6 16 – ) = = 1’s complement of = 2’s complement of = = in 2’s complement = - ( ) = = - 0B 16 or Note: C and N bits will be set. C is set to 1 because the absolute value of subtraction (17) Is larger than the absolute value of the minuend (6)

George W. Woodruff School of Mechanical Engineering, Georgia Tech ME4447/6405 Since bit 7 serves as the sign bit. A ‘0’ in bit 7 indicates a positive number. Thus the maximum positive number an 8-bit processor can represent in 2’s complement is or 7F 16 or Likewise a ‘1’ in bit 7 indicates a negative number. The minimum negative number that an 8-bit processor can represent in 2’s complement is ( ). In binary it is 2’s complement of = = = Its 2’s complement is – ( ) = - ( ) = = It is possible to (add) or subtract two numbers and get invalid answer, especially when the answer is out of the range of –128  +127 This situation is referred to as 2’s complement overflow. If a subtraction (or addition) is performed and 2’s complement overflow occurs the V bit will be set to a ‘1’ otherwise it will be cleared.

George W. Woodruff School of Mechanical Engineering, Georgia Tech ME4447/6405 Example 3: = = = = 1’s comp. of = 2’s comp. of = 5A 16 = = 1’s comp. of 5A = 2’s comp. of 5A = (2’s comp. of ) = (2’s comp. of 5A 16 ) = = V bit will be set. C bit will be set.

George W. Woodruff School of Mechanical Engineering, Georgia Tech ME4447/6405 Example 4: 4D positive positive negative V bit is set.

George W. Woodruff School of Mechanical Engineering, Georgia Tech ME4447/6405

ME4447/6405 Logic Gates Why do we study Logic Gates? –Used to Determine Status or Occurrence of Events

George W. Woodruff School of Mechanical Engineering, Georgia Tech ME4447/6405 “AND” Function Input A Output C Input B Symbol Equation C = A ● B

George W. Woodruff School of Mechanical Engineering, Georgia Tech ME4447/6405 “OR” Function Input A Output C Input B Symbol Equation C = A + B

George W. Woodruff School of Mechanical Engineering, Georgia Tech ME4447/6405 “Exclusive OR” Function (XOR) Input A Output C Input B Symbol Equation C = A + B

George W. Woodruff School of Mechanical Engineering, Georgia Tech ME4447/6405 Input A Output C “Not” Function (Inverter) Symbol Equation C = A

George W. Woodruff School of Mechanical Engineering, Georgia Tech ME4447/6405 “NOR” Function Input A Output C Input B Input A Output C Input B “NAND” Function

George W. Woodruff School of Mechanical Engineering, Georgia Tech ME4447/6405 QUESTIONS???