Engineering 1040: Mechanisms & Electric Circuits Spring 2014 Number Systems.

Slides:



Advertisements
Similar presentations
Intro to CS – Honors I Representing Numbers GEORGIOS PORTOKALIDIS
Advertisements

Representing Numbers: Integers
CS 151 Digital Systems Design Lecture 3 More Number Systems.
MOHD. YAMANI IDRIS/ NOORZAILY MOHAMED NOOR 1 Lecture 3 Number System.
Chapter Chapter Goals Know the different types of numbers Describe positional notation.
ECE 331 – Digital System Design
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)
ENGIN112 L3: More Number Systems September 8, 2003 ENGIN 112 Intro to Electrical and Computer Engineering Lecture 3 More Number Systems.
S. Barua – CPSC 240 CHAPTER 2 BITS, DATA TYPES, & OPERATIONS Topics to be covered are Number systems.
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.
COE 202: Digital Logic Design Number Systems Part 1
EE 261 – Introduction to Logic Circuits
Number Systems Lecture 02.
3. Representing Integer Data
NEGATIVE BINARY NUMBER – Digital Circuit 1 Choopan Rattanapoka.
Dr. Bernard Chen Ph.D. University of Central Arkansas
Computer Systems 1 Fundamentals of Computing Negative Binary.
ACOE1611 Data Representation and Numbering Systems Dr. Costas Kyriacou and Dr. Konstantinos Tatas.
Numbering systems.
CS105 INTRODUCTION TO COMPUTER CONCEPTS BINARY VALUES & NUMBER SYSTEMS Instructor: Cuong (Charlie) Pham.
Numeral Systems Subjects: Numeral System Positional systems Decimal
Data Representation – Binary Numbers
Chapter 7 Arithmetic Operations and Circuits Binary Arithmetic Addition –When the sum exceeds 1, carry a 1 over to the next-more-significant column.
#1 Lec # 2 Winter EECC341 - Shaaban Positional Number Systems A number system consists of an order set of symbols (digits) with relations.
1 Digital Technology and Computer Fundamentals Chapter 1 Data Representation and Numbering Systems.
Dale & Lewis Chapter 3 Data Representation. Data and computers Everything inside a computer is stored as patterns of 0s and 1s Numbers, text, audio, video,
EX_01.1/46 Numeric Systems. EX_01.2/46 Overview Numeric systems – general, Binary numbers, Octal numbers, Hexadecimal system, Data units, ASCII code,
ECEN2102 Digital Logic Design Lecture 1 Numbers Systems Abdullah Said Alkalbani University of Buraimi.
Number Systems Spring Semester 2013Programming and Data Structure1.
Information Representation. Digital Hardware Systems Digital Systems Digital vs. Analog Waveforms Analog: values vary over a broad range continuously.
Logic Design Dr. Yosry A. Azzam. Binary systems Chapter 1.
Number Systems. Today Decimal Hexadecimal Binary –Unsigned Binary –1’s Complement Binary –2’s Complement Binary.
Representation of Data Ma King Man. Reference Text Book: Volume 2 Notes: Chapter 19.
Lecture 4 Last Lecture –Positional Numbering Systems –Converting Between Bases Today’s Topics –Signed Integer Representation Signed magnitude One’s complement.
Chapter 2 Binary Values and Number Systems. 2 2 Natural Numbers Zero and any number obtained by repeatedly adding one to it. Examples: 100, 0, 45645,
Computer Arithmetic and the Arithmetic Unit Lesson 2 - Ioan Despi.
Chapter 2: The Logic of Compound Statements 2.5 Application: Number Systems and Circuits for Addition 1 Counting in binary is just like counting in decimal.
Cosc 2150: Computer Organization Chapter 2 Part 1 Integers addition and subtraction.
CCE-EDUSAT SESSION FOR COMPUTER FUNDAMENTALS Date: Session III Topic: Number Systems Faculty: Anita Kanavalli Department of CSE M S Ramaiah.
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.
Lecture 2 Binary Values and Number Systems. The number 943 is an example of a number written in positional notation. The relative positions of the digits.
Number Systems and Logic Prepared by Dr P Marais (Modified by D Burford)
THE BINARY SYSTEM.
AEEE2031 Data Representation and Numbering Systems.
Number Systems & Operations
Kavita Bala CS 3410, Spring 2014 Computer Science Cornell University.
WEEK #2 NUMBER SYSTEMS, OPERATION & CODES (PART 1)
Number Systems by Dr. Amin Danial Asham. References  Programmable Controllers- Theory and Implementation, 2nd Edition, L.A. Bryan and E.A. Bryan.
School of Computer and Communication Engineering, UniMAP Mohd ridzuan mohd nor DKT 122/3 - DIGITAL SYSTEM I Chapter.
© 2009 Pearson Education, Upper Saddle River, NJ All Rights ReservedFloyd, Digital Fundamentals, 10 th ed Digital Logic Design Dr. Oliver Faust.
IT1004: Data Representation and Organization Negative number representation.
Chapter 1 Number Systems Digital Electronics. Topics discussed in last lecture Digital systems Advantages of using digital signals over analog. Disadvantages.
1 Digital Logic Design Lecture 2 More Number Systems/Complements.
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 2: 8/29/2002CS149D Fall CS149D Elements of Computer Science Ayman Abdel-Hamid Department of Computer Science Old Dominion University Lecture.
Lecture No. 4 Computer Logic Design. Negative Number Representation 3 Options –Sign-magnitude –One’s Complement –Two’s Complement  used in computers.
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.
Binary Values. Numbers Natural Numbers Zero and any number obtained by repeatedly adding one to it. Examples: 100, 0, 45645, 32 Negative Numbers.
Cosc 2150: Computer Organization
Addition and Subtraction
CHAPTER 1 : INTRODUCTION
CSE 102 Introduction to Computer Engineering
Chapter 3 Data Representation
IT 0213: INTRODUCTION TO COMPUTER ARCHITECTURE
University of Gujrat Department of Computer Science
Data Representation in Computer Systems
Digital Logic & Design Lecture 02.
Digital Logic Design (ECEg3141) 2. Number systems, operations & codes 1.
Presentation transcript:

Engineering 1040: Mechanisms & Electric Circuits Spring 2014 Number Systems

Introduction (1) A number system is a well defined structured way of representing or expressing numbers as a combination of the elements of a finite set of mathematical symbols (i.e., digits). The functions of a number system are: – Represent a useful set of numbers. For example, all integers or rational numbers. – Give each number a standard representation. There are two major types of number systems. These are, 1. Positional number systems 2. Non positional number system

Introduction (2) 1. Positional number systems This uses the same symbol for different orders of magnitude This greatly simplifies arithmetic. Eg: Decimal, binary & hexadecimal number systems. 2. Non positional number system It combines digits to signify their sums or their differences. The sum/difference represents a number. Eg: Roman number system where MMXI represents 2011, IX represents 9. In this section we will consider Decimal, binary & hexadecimal number systems.

General Representation of a Number System In general, the number a 3 a 2 a 1 a 0 in a base b number system represents the following number: a 3 a 2 a 1 a 0 = a 3 * b 3 + a 2 * b 2 + a 1 * b 1 + a 0 * b 0 Base is the number of unique digits including zero. Eg: Decimal number system has 10 digits (0, 1 … 9). Therefore, the base is 10. Binary number system has 2 digits (0, 1). Therefore, the base is 2. Hexadecimal number system has 16 digits (0, F). Therefore, the base is 16.

Digits used for number systems

Counting under these number systems

Binary number system The binary number system represents numerical values using two symbols, 0 and 1. This is a positional number system. The binary system has a base of 2 with a radix of 2. In general a number could be represented as a binary number as follows, a n …a 3 a 2 a 1 a 0 = a n * 2 n +a 3 * a 2 * a 1 * a 0 * 2 0 These numbers are straightforward to implement, hence used in digital circuitry, logic gates and in almost all modern computers. 1 and 0 in binary numbers correspond to the ON and OFF in digital systems.

Most Significant Bit & Least Significant Bit Most Significant Bit (MSB) Least Significant Bit (LSB) Indicates the sign bit in some cases Indicates whether the number is odd or even

Decimal range covered by some commonly used bit values Bit valuesDecimal Range , ,294,967, × 10 19

Binary to Decimal Conversion Convert (1101) 2 to a decimal number. Convert 8 bit ( ) 2 to a decimal number. What is the MSB and LSB of the number?

Decimal to Binary Conversion – Power Method Step 1: Find the highest whole power of 2 contained in the decimal number. Step 2: Subtract the highest whole power of 2 from the decimal number. Step 3: Repeat Step 1 with the remainder. Step 4: Construct the binary number by placing a 1 in the position which corresponds to power value of the highest whole power of 2.

Decimal to Binary Conversion – Remainder Method Step 1: Divide the decimal number by the base (in the case of binary, divide by 2). Step 2: Indicate the remainder to the right. Step 3: Continue dividing into each quotient (and indicating the remainder) until the divide operation produces a zero quotient.

Hexadecimal Number System (1) Hexadecimal number system is a human-friendly binary number representation. Using this method it is possible to give the numbers a much compact representation. Each hexadecimal digit represents 4-bits. An 8-bit binary number can be represented by two hexadecimal digits. Eg: ( ) 2 can be represented by FE 16. ( ) 2 can be represented by Both the power method and remainder method applies to hexadecimal number system.

Hexadecimal Number System (2) Ex: Convert ABCDEF in hexadecimal into a decimal number. Convert into hexadecimal using the power method and the remainder method.

Decimal HexadecimalBinary

Representing Negative Numbers in Binary There are different techniques used to represent negative numbers in binary. These are, – Signed magnitude method – One's complement method – Two's complement method

Signed magnitude method This approach is directly similar to the most common way of constructing a sign. – i.e. placing ‘+’ or ‘-’ in front of a number According to this method the MSB indicates the sign of the number. – 0 indicates +ve & 1 indicates –ve Eg: 8-bit, = = Some of the early computers (eg. IBM 7090) used this method.

Signed magnitude method In signed magnitude, the left-most bit is not actually part of the number, but is just the equivalent of a + or - sign. Arithmetic operations Eg: 8-bit, = = = Answer =  Is this correct? Can we use this for arithmetic operations? NO

One's complement method (1) Positive numbers are represented as a regular binary numbers. Negative numbers are represented differently. Under this method in order to negate a number, it replaces all zeros with ones, and ones with zeros i.e. take the compliment. Eg: +12 would be & -12 would be As in sign magnitude MSB indicates the sign (‘0’ is +ve, ‘1’ is -ve).

One's complement method (2) Representation of 4-bit binary in one’s compliment method. One drawback of this method is that it has two different representations of zero.

Two's complement method (1) Begin with the number in one's complement. Add 1 if the number is negative. Eg: – would be represented as , and as – To verify this, let's subtract 1 from , to get – If we flip the bits, we get , or 12 in decimal.

Converting Decimal to n-bit Binary using Two's complement method For Positive Numbers: 1.Convert the magnitude of the number to binary. 2.Add zeros to make the binary number an n-bit number. Ex: If your number consists of 5 bits but the goal is to get a number consisting 8-bits, pad the 5-bit binary number by adding three zeros to the left. For Negative Numbers: 1.Convert the magnitude of the number to binary. 2.Add zeros to the left to make the binary number to have n digits. 3.Complement the number (i.e., invert the bits). 4.Add 1 to the inverted binary number to get the n-bit 2's complement notation.

Converting n-bit 2's Complement Binary to Decimal 1. Look at the leftmost bit to determine whether the number is positive or negative. If the leftmost bit is 0, the number is positive. If the leftmost bit is 1, the number is negative. 2. If positive, convert the number from binary to decimal. 3. If negative, determine the magnitude by: – Invert the bits of the binary number. – Add 1 to the inverted number. – Convert the result of the addition operation to decimal to get the magnitude of the corresponding decimal number. – The actual decimal number is the negative of this number.

4-bit Binary in 2's Complement Method