COE 202- Digital Logic. Number Systems II. Dr. Abdulaziz Y. Barnawi COE Department KFUPM. January 23, Abdulaziz Barnawi. COE 202 Logic Design

Similar documents
COE 202: Digital Logic Design Number Systems Part 2. Dr. Ahmad Almulhem ahmadsm AT kfupm Phone: Office:

Octal & Hexadecimal Number Systems. Digital Electronics

Moodle WILLINGDON COLLEGE SANGLI. ELECTRONICS (B. Sc.-I) Introduction to Number System

Number Systems. TA: Mamun. References: Lecture notes of Introduction to Information Technologies (ITEC 1011) by Dr Scott MacKenzie

Positional notation Ch Conversions between Decimal and Binary. /continued. Binary to Decimal

Number representations

COMP Overview of Tutorial #2

Data Representation COE 301. Computer Organization Prof. Muhamed Mudawar

TOPICS. Other Number Systems. Other Number Systems 9/9/2017. Octal Hexadecimal Number conversion

CMPE223/CMSE222 Digital Logic Design. Positional representation

Level ISA3: Information Representation

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

CHW 261: Logic Design

Chapter 3 DATA REPRESENTATION

Number Systems and Binary Arithmetic. Quantitative Analysis II Professor Bob Orr

Review of Number Systems

CHAPTER V NUMBER SYSTEMS AND ARITHMETIC

MACHINE LEVEL REPRESENTATION OF DATA

Lecture (01) Digital Systems and Binary Numbers By: Dr. Ahmed ElShafee

Number System. Introduction. Decimal Numbers

Chapter Binary Representation of Numbers

CS & IT Conversions. Magnitude 10,000 1,

Lecture (01) Introduction Number Systems and Conversion (1)

Digital Systems COE 202. Digital Logic Design. Dr. Muhamed Mudawar King Fahd University of Petroleum and Minerals

DLD VIDYA SAGAR P. potharajuvidyasagar.wordpress.com. Vignana Bharathi Institute of Technology UNIT 1 DLD P VIDYA SAGAR

Digital Logic Lecture 2 Number Systems

Chapter 1 Review of Number Systems

in this web service Cambridge University Press

DATA REPRESENTATION. By- Neha Tyagi PGT CS KV 5 Jaipur II Shift, Jaipur Region. Based on CBSE curriculum Class 11. Neha Tyagi, KV 5 Jaipur II Shift

Switching Circuits and Logic Design Prof. Indranil Sengupta Department of Computer Science and Engineering Indian Institute of Technology, Kharagpur

1.3 Systems of numeration: To represent quantities in the different systems of numeration, specific symbols are used, which are also called ciphers.

2 Number Systems 2.1. Foundations of Computer Science Cengage Learning

ITEC 1011 Introduction to Information Technologies

Introduction to Computer Science (I1100) With 1 coin 2 possibilities: Head / Tail or 0/1

Chapter 2 Binary Values and Number Systems

T02 Tutorial Slides for Week 2

Beyond Base 10: Non-decimal Based Number Systems

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

CS321. Introduction to Numerical Methods

Lecture 1: Digital Systems and Number Systems

The. Binary. Number System

Chapter 1 Emad Felemban

Computer Arithmetic. Appendix A Fall 2003 Lec.03-58

6. Binary and Hexadecimal

Beyond Base 10: Non-decimal Based Number Systems

CHAPTER 2 Number Systems

Outline. What Digit? => Number System. Decimal (base 10) Significant Digits. Lect 03 Number System, Gates, Boolean Algebra. CS221: Digital Design

Lecture 2: Number Systems

Digital Fundamentals

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

umber Systems bit nibble byte word binary decimal

Chapter 4 Section 2 Operations on Decimals

TOPIC: NUMBER SYSTEMS

Assembly Language for Intel-Based Computers, 4 th Edition. Chapter 1: Basic Concepts. Chapter Overview. Welcome to Assembly Language

MC1601 Computer Organization

Korea University of Technology and Education

Fundamentals of Programming (C)

QUIZ: Generations of computer technology. Hardware:

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

What Is It? Instruction Register Address Register Data Register

Octal and Hexadecimal Integers

Chapter 10 Binary Arithmetics

Introduction to Numbering Systems

Computer Sc. & IT. Digital Logic. Computer Sciencee & Information Technology. 20 Rank under AIR 100. Postal Correspondence

Number Systems Base r

Chapter 2 Number Systems and Codes Dr. Xu

Fractions. Dividing the numerator and denominator by the highest common element (or number) in them, we get the fraction in its lowest form.

Conversion Between Number Bases

College of Computer and Information Sciences Department of Computer Science. CSC 220: Computer Organization. Unit1 Number Systems

Number Systems CHAPTER Positional Number Systems

SCHOOL OF ENGINEERING & BUILT ENVIRONMENT. Mathematics. Numbers & Number Systems

LECTURE 1-2. Introduction and Number Systems

Common Number Systems

Objectives. Connecting with Computer Science 2

Tutorial for Chapter 3, 4

Decimal/Binary Conversion on the Soroban

Chapter 03: Computer Arithmetic. Lesson 09: Arithmetic using floating point numbers

Numeral Systems. -Numeral System -Positional systems -Decimal -Binary -Octal. Subjects:

Chapter Overview. Assembly Language for Intel-Based Computers, 4 th Edition. Chapter 1: Basic Concepts. Printing this Slide Show

Organisasi Sistem Komputer

Rational numbers as decimals and as integer fractions

Integer Multiplication and Division

Number Systems & Encoding

Numbering systems. Dr Abu Arqoub

World Inside a Computer is Binary

Numbers!!...is that right? CSCI 255

Chapter 2. Positional number systems. 2.1 Signed number representations Signed magnitude

QUIZ: Generations of computer technology. Hardware:

Chapter 2. Binary Values and Number Systems

Lesson 14: Converting Rational Numbers to Decimals Using Long Division

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

CMPS 10 Introduction to Computer Science Lecture Notes

Section 2.3 Rational Numbers. A rational number is a number that may be written in the form a b. for any integer a and any nonzero integer b.

Unit 3.2: Fractions, Decimals and Percent Lesson: Comparing and Ordering Fractions and Decimals

Electronic Data and Instructions

Chapter 1 Preliminaries

Number Systems. Both numbers are positive

Rui Wang, Assistant professor Dept. of Information and Communication Tongji University.

Chapter 5: Computer Arithmetic. In this chapter you will learn about:

Digital Systems and Binary Numbers

Transcription:

1 COE 0- Digital Logic Number Systems II Dr. Abdulaziz Y. Barnawi COE Department KFUPM COE 0 Logic Design January 3, 016

Objectives Base Conversion Decimal to other bases Binary to Octal and Hexadecimal Any base to any base COE 0 Logic Design January 3, 016

3 Converting Decimal Integers to Binary Divide the decimal number by Repeat division until a quotient of 0 is produced The sequence of remainders in reverse order constitute the binary conversion Example: (41) 10 = (101001) LSB MSB 41 Remainder = 1 0 0 10 10 5 Remainder = 0 Remainder = 0 5 Remainder = 1 Remainder = 0 1 1 Remainder = 1 0 Stopping Condition Verify: 1 x 5 + 0 x 4 + 1 x 3 + 0 x + 0 x 1 + 1 x 0 = (41) 10 COE 0 Logic Design January 3, 016

4 Another Procedure for Converting from Decimal to Binary Start with a binary representation of all 0 s Determine the highest possible power of two that is less or equal to the number Put a 1 in the bit position corresponding to the highest power of two found above Subtract the highest power of two found above from the number Repeat the process for the remaining number COE 0 Logic Design January 3, 016

5 Another Procedure for Converting from Decimal to Binary Example: Converting (76) 10 to Binary The highest power of less or equal to 76 is 64, hence the seventh (MSB) bit is 1 Subtracting 64 from 76 we get 1. The highest power of less or equal to 1 is 8, hence the fourth bit position is 1 We subtract 8 from 1 and get 4. The highest power of less or equal to 4 is 4, hence the third bit position is 1 Subtracting 4 from 4 yield a zero, hence all the left bits are set to 0 to yield the final answer COE 0 Logic Design January 3, 016

6 Decimal to binary conversion chart COE 0 Logic Design January 3, 016

7 Converting Decimal Integer to Octal Divide the decimal number by 8 Repeat division until a quotient of 0 is received The sequence of remainders in reverse order constitute the octal conversion Example: (153) 10 = (31) 8 LSB 153 Remainder = 1 19 8 19 8 Remainder = 3 MSB 8 0 Remainder = Stopping Condition Verify: x8 + 3 x 8 1 + 1 x 8 0 = (153) 10 COE 0 Logic Design January 3, 016

8 Converting Decimal Integer to Hexadecimal Divide the decimal number by 16 Repeat division until a quotient of 0 is received The sequence of remainders in reverse order constitute the hexadecimal conversion Example: (4) 10 = (1A6) 16 COE 0 Logic Design January 3, 016

9 Converting Decimal Fraction to Binary Multiply the decimal number by Repeat multiplication until a fraction value of 0.0 is reached or until the desired level of accuracy is reached The sequence of integers before the decimal point constitute the binary number Example: (0.6875) 10 = (0.1011) MSB LSB 0.6875 x = 1.3750 0.3750 x = 0.7500 0.7500 x = 1.5000 0.5000 x = 1.0000 0.0000 Verify: 1x - 1 + 0 x - + 1 x - 3 + 1 x - 4 = (0.6875) 10 Stopping Condition COE 0 Logic Design January 3, 016

10 Converting Decimal Fraction to Octal Multiply the decimal number by 8 Repeat multiplication until a fraction value of 0.0 is reached or until the desired level of accuracy is reached The sequence of integers before the decimal point constitute the octal number Example: (0.513) 10 = (0.4065 ) 8 MSB LSB 0.513 x 8 = 4.104 0.104 x 8 = 0.83 0.83 x 8 = 6.656 0.656 x 8 = 5.48.... Verify: 4x8-1 + 0 x 8 - + 6 x 8-3 + 5 x 8-4 = (0.513) 10 COE 0 Logic Design January 3, 016

11 Converting both Integer & Fraction Question. How to convert a decimal number that has both integral and fractional parts? Answer. Convert each part separately, combine the two results with a point in between. Example: Consider the decimal - > octal examples in previous slides (153.513) 10 = (31.407) 8 COE 0 Logic Design January 3, 016

1 Example Convert (11.650) 10 Steps: to binary? Split the number into integer and fraction Perform the conversions for the integer and fraction part separately Rejoin the results after the individual conversions COE 0 Logic Design January 3, 016

13 Example 11 105 Remainder = 1 105 5 Remainder = 1 5 6 Remainder = 0 6 13 Remainder = 1 13 6 Remainder = 1 6 3 Remainder = 0 3 1 Remainder = 1 Integer part fraction part 0.650 0.500 0.5000 Combining the results gives us: (11.650) 10 = (11011011.101) 1.5 0.50 1.00 LSB MSB 1 Remainder = 1 0 COE 0 Logic Design January 3, 016

14 Converting Binary to Octal Example: Convert (1110010101.1011011) into Octal. COE 0 Logic Design January 3, 016

15 Binary to Hexadecimal Conversion Example: Convert (1110010101.1011011) into hex. COE 0 Logic Design January 3, 016

16 Converting between other bases Question. How to convert between bases other than decimal; e.g. from base- 4 to base- 6? Answer. Two steps: convert source base to decimal convert decimal to destination base COE 0 Logic Design January 3, 016

17 Converting Hexadecimal to Octal (special case) In this case, we can use binary as an intermediate step instead of decimal Example: (3A) 16 = (0011-1010) = (000-111- 010) = (07) 8 0 added re-group by 3 COE 0 Logic Design January 3, 016

18 Converting Octal to Hexadecimal (special case) In this case, we can use binary as an intermediate step instead of decimal Example: (7) 8 = (111-010) = (0011-1010) = (3A) 16 0 added re-group by 4 COE 0 Logic Design January 3, 016

19 Conclusions To convert from decimal to base- r, divide by r for the integral part, multiply by r for the fractional part, then combine To convert from binary to octal (hexadecimal) group bits into 3 (4) To convert between bases other than decimal, first convert source base to decimal, then convert decimal to the destination base. COE 0 Logic Design January 3, 016