Dale Roberts Department of Computer and Information Science, School of Science, IUPUI CSCI 230 Information Representation: Positive Integers Dale Roberts,

Slides:



Advertisements
Similar presentations
NUMBER SYSTEM. How to convert hexadecimal numbers to decimal numbers? 230 Working from right to left, MULTIPLY each position with 8 raised to the power.
Advertisements

Appendix 1 Number Systems Objectives: Review of number systems and radix conversion methods Review of binary, octal, hexadecimal and BCD unsigned codes.
Data Representation COE 202 Digital Logic Design Dr. Aiman El-Maleh
DATA REPRESENTATION CONVERSION.
Number Systems & Operations
Chapter Chapter Goals Know the different types of numbers Describe positional notation.
Chapter 02 Binary Values and Number Systems Nell Dale & John Lewis.
BASICS OF COMPUTER APPLICATIONS ASB 102. UNIT 1 Introducing computer system  Number system  What is number system?  Types of number system  Their.
 Binary Binary  Binary Number System Binary Number System  Binary to Decimal Binary to Decimal  Decimal to Binary Decimal to Binary  Octal and Hexadecimal.
Real Numbers and the Decimal Number System
Number Systems.
Numbering systems.
Numeral Systems Subjects: Numeral System Positional systems Decimal
Numbering Systems CS208.
1 Number SystemsLecture 8. 2 BINARY (BASE 2) numbers.
Dale Roberts Department of Computer and Information Science, School of Science, IUPUI CSCI 230 Information Representation: Negative and Floating Point.
Chapter 3 Data Representation
CHAPTER 1 INTRODUCTION NUMBER SYSTEMS AND CONVERSION.
Supplemental Chapter Number Bases
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,
Number Systems Ron Christensen CIS 121.
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
Numbering System Base Conversion. Number systems Decimal – 0, 1, 2, 3, 4, 5, 6, 7, 8, 9 Binary – 0, 1 Octal – 0, 1, 2, 3, 4, 5, 6, 7 Hexadecimal system.
Digital Logic Lecture 2 Number Systems
CMSC 104, Lecture 051 Binary / Hex Binary and Hex The number systems of Computer Science.
Positional Notation 642 in base 10 positional notation is:
Number Base Conversions
Dale Roberts Department of Computer and Information Science, School of Science, IUPUI CSCI N305 Information Representation: Floating Point Representation.
Digital Electronics Octal & Hexadecimal Number Systems.
Binary01.ppt Decimal Decimal: Base 10 means 10 Unique numerical digits ,00010,000 Weight Positions 3,
Digital Systems Digital Logic and Design Dr. Musab Bassam Zghool Text Book: Mano Morris M. “ Digital Logic And Computer Design ”
Dale Roberts Department of Computer and Information Science, School of Science, IUPUI CSCI N305 Information Representation: Negative Integer Representation.
Lecture 2 Number Systems
Octal & Hexadecimal Number Systems
Principles & Applications
Computer Number System
Number System Base b Use only digits of 0, 1, 2,…., b-1 Positional weights X = a n-1 b n-1 + a n-2 b n-2 + …. + a 0 b = 1x x10 1 +
Number Systems. Topics  The Decimal Number System  The Binary Number System  Converting from Binary to Decimal  Converting from Decimal to Binary.
Lecture 6: Floating Point Number Representation Information Representation: Floating Point Number Representation Lecture # 7.
ECE DIGITAL LOGIC LECTURE 2: DIGITAL COMPUTER AND NUMBER SYSTEMS Assistant Prof. Fareena Saqib Florida Institute of Technology Fall 2016, 01/14/2016.
CSC 110 – Intro to Computing Lecture 3: Converting between bases & Arithmetic in other bases.
Number Systems. ASCII – American Standard Code for Information Interchange – Standard encoding scheme used to represent characters in binary format on.
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.
Dr. Nermin Hamza 1. Materials Book: Digital Design 4 th M. Morris Mano and Michael D. Ciletti 2.
Prepared By: Norakmar Binti Mohd Nadzari CHAPTER 2 ARITHMETIC AND LOGIC UNIT.
Lecturer: Santokh Singh
Introduction To Number Systems
Octal to Decimal Decimal Octal Binary Hexadecimal.
CHAPTER 1 INTRODUCTION NUMBER SYSTEMS AND CONVERSION
Location in course textbook
Chapter 3 Data Representation
Number System conversions
Chapter 1 Number Systems & Conversions
Number Systems and Binary Arithmetic
Introduction to IT By: Muhammed s. anwar.
Digital Electronics Ms. Deepa Mehta.
Negative Integer Representation
Numbering System TODAY AND TOMORROW 11th Edition
Digital Electronics and Microprocessors
Chapter 2: Number Systems
Digital Logic Design (CSNB163)
Chapter Four Data Representation in Computers By Bezawit E.
COMS 161 Introduction to Computing
Information Representation
COE 202: Digital Logic Design Number Systems Part 2
1. Number Systems Chapt. 2.
Presentation transcript:

Dale Roberts Department of Computer and Information Science, School of Science, IUPUI CSCI 230 Information Representation: Positive Integers Dale Roberts, Lecturer

Dale Roberts Information Representation Computer use a binary systems Why binary? Electronic bi-stable environment on/off, high/low voltage Bit: each bit can be either 0 or 1 Reliability With only 2 values, can be widely separated, therefore clearly differentiated “drift” causes less error Example: -3 mv 0 mv Digital v.s, Analog

Dale Roberts Binary Representation in Computer System – –All information of diverse type is represented within computers in the form of bit patterns. e.g., text, numerical data, sound, and images – –One important aspect of computer design is to decide how information is converted ultimately to a bit pattern – –Writing software also frequently requires understanding how information is represented along with accuracies

Dale Roberts Number Systems Decimal Number System Base is 10 or ‘D’ or ‘Dec’ Ten symbols: 0, 1, 2, 3, 4, 5, 6, 7, 8, 9 Each place is weighted by the power of 10 Example: or D = 1 x x x x x x = $1,000 $100 $10 $1 10¢ 1¢1¢

Dale Roberts Binary Number System Base is 2 or ‘b’ or ‘B’ or ‘Bin’ Two symbols: 0 and 1 Each place is weighted by the power of 2 Example: or 1011 B = 1 x x x x 2 0 = = in decimal number system is 1011 in binary number system

Dale Roberts Conversion between Decimal and Binary Conversion from decimal number system to binary system Question: represent in the binary number system Answer: using the divide-by-2 technique repeatedly If we write the remainder from right to left :  1 x x x x x x 2 0  Remainder div-by-2

Dale Roberts Practice Exercises 13 D = (?) B 23 D = (?) B 72 D = (?) B B Blocks:

Dale Roberts Conversion between Binary and Decimal Conversion from binary number system to decimal system Example: check if is using the :weights” appropriately  1 x x x x x x 2 0   34 10

Dale Roberts Practice Exercises Ex: 0101 B  ( ? ) D Ex: 1100 B  ( ? ) D Ex: B  ( ? ) D Bit = 8 Bit = 4 Bit = 2 Bit = = 5 D = 12 D = 92 D

Dale Roberts Binary Arithmetic on Integers Addition a ba + b D + 5 D 18 D 15 D + 10 D 25 D Example: find binary number of a + b If a = 13 D, b = 5 D If a = 15 D, b = 10 D b b b b b + 10b0b 001 Carry bit

Dale Roberts Multiplication Binary Arithmetic on Integers a ba x b b x b  33 D  5 D  165 D b Example: if a = b, b = 101 b, find a x b

Dale Roberts Hexadecimal Number System Base = 16 or ‘H’ or ‘Hex’ 16 symbols: { 0, 1, 2, 3, 4, 5, 6, 7, 8, 9, A( =10 ), B( =11 ), C( =12 ), D( =13 ), E( =14 ), F( =15 )} Hexadecimal to Decimal (a n-1 a n-2 …a 1 a 0 ) 16 = (a n-1 x 16 n-1 + a n-2 x 16 n-2 + …+ a 1 x a 0 x 16 0 ) D Example: (1C7) 16 = (1 x x x 16 0 ) 10 = ( ) 10 = (455) 10 Decimal to Hexadecimal Decimal to Hexadecimal Repeated division by 16 binary codes Similar in principle to generating binary codes Example: (829) 10 = (? ) 16 Stop, since quotient = 0 Hence, (829) 10 = (33D) 16 Hence, (829) 10 = (33D) 16 Divide-by-16QuotientRemainderHexadecimal digit 829 / / 16 3 / Lower digit = D Second digit =3 Third digit =3

Dale Roberts Hexadecimal Conversions Hexadecimal to Binary Expand each hexadecimal digit to 4 binary bits. Example: (E29) 16 = (1110 | 0010 | 1001) 2 Binary to Hexadecimal Combine every 4 bits into one hexadecimal digit Example: (0101 | 1111 | 1010 | 0110) 2 = (5FA6) 16

Dale Roberts Octal Number System Base = 8 or ‘o’ or ‘Oct’ 8 symbols: { 0, 1, 2, 3, 4, 5, 6, 7} Octal to Decimal (a n-1 a n-2 …a 1 a 0 ) 8 = (a n-1 x 8 n-1 + a n-2 x 8 n-2 + …+ a 1 x a 0 x 8 0 ) 10 Example: (127) 8 = (1 x x x 8 0 ) 10 = ( ) 10 = (87) 10 Decimal to Octal Repeated division by 8 (similar in principle to generating binary codes) Example: (213) 10 = (? ) 8 Stop, since quotient = 0 Stop, since quotient = 0 Hence, (213) 10 = (325) 8 Hence, (213) 10 = (325) 8 Divide-by -8QuotientRemainderOctal digit 213 / 8 26 / 8 3 / Lower digit = 5 Second digit =2 Third digit =3

Dale Roberts Octal Conversions Octal to Binary Expand each octal digit to 3 binary bits. Example: (725) 8 = (111 | 010 | 101) 2 Binary to Octal Combine every 3 bits into one octal digit Example: (110 | 010 | 011) 2 = (623) 8

Dale Roberts Practice Exercises 1) Convert the following binary numbers to decimal numbers: (a) 0011 B (b) 0101 B (c) B (d) B 2) Convert the following decimal numbers to binary: (a) 21 D (b) 731 D (c) 1,023 D

Dale Roberts Practice Exercises 3) Convert the following binary numbers to hexadecimal numbers: (a) 0011 B (b) 0101 B (c) B (d) B (a) 21 D (b) 731 D (c) 1,023 D 4.)Perform the following binary additions and subtractions. Show your work without using decimal numbers during conversion. (a) 111 B B (b) 1001 B + 11 B

Dale Roberts Acknowledgements These slides where originally prepared by Dr. Jeffrey Huang, updated by Dale Roberts.