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

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

Digital Logic Lecture 2 Number Systems

Digital Systems and Binary Numbers

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

Number System. Introduction. Decimal Numbers

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

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

CS & IT Conversions. Magnitude 10,000 1,

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

Korea University of Technology and Education

MC1601 Computer Organization

Electronic Data and Instructions

Common Number Systems

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

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

ITEC 1011 Introduction to Information Technologies

Level ISA3: Information Representation

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

EEM 232 Digital System I

Number representations

Digital Systems and Binary Numbers

Fundamentals of Programming (C)

Digital Systems and Binary Numbers

CHW 261: Logic Design

3.1. Unit 3. Binary Representation

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

Number Systems CHAPTER Positional Number Systems

Bits. Binary Digits. 0 or 1

Number Systems. Decimal numbers. Binary numbers. Chapter 1 <1> 8's column. 1000's column. 2's column. 4's column

CMPS 10 Introduction to Computer Science Lecture Notes

Introduction to Numbering Systems

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

Lecture 1: Digital Systems and Number Systems

CHAPTER 2 Number Systems

CMPE223/CMSE222 Digital Logic Design. Positional representation

2 Number Systems 2.1. Foundations of Computer Science Cengage Learning

Chapter 1 Review of Number Systems

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

Digital Fundamentals

CMSC 313 COMPUTER ORGANIZATION & ASSEMBLY LANGUAGE PROGRAMMING LECTURE 01, SPRING 2013

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

What Is It? Instruction Register Address Register Data Register

EE 109 Unit 2. Binary Representation Systems

DIGITAL SYSTEM DESIGN

Chap 1. Digital Computers and Information

1.1. Unit 1. Integer Representation

Objectives. Connecting with Computer Science 2

LOGIC DESIGN. Dr. Mahmoud Abo_elfetouh

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

Chapter 1 Emad Felemban

Information Science 1

The. Binary. Number System

Bits, bytes and digital information. Lecture 2 COMPSCI111/111G

Introduction to Computers and Programming. Numeric Values

10.1. Unit 10. Signed Representation Systems Binary Arithmetic

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

Computer Number Systems Supplement

Octal & Hexadecimal Number Systems. Digital Electronics

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

Lecture 1: What is a computer?

Binary. Hexadecimal BINARY CODED DECIMAL

in this web service Cambridge University Press

TOPIC: NUMBER SYSTEMS

MACHINE LEVEL REPRESENTATION OF DATA

Final Labs and Tutors

EE 109 Unit 3. Analog vs. Digital. Analog vs. Digital. Binary Representation Systems ANALOG VS. DIGITAL

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

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

Unit 3. Analog vs. Digital. Analog vs. Digital ANALOG VS. DIGITAL. Binary Representation

COMP Overview of Tutorial #2

Lecture 2: Number Systems

EE 109 Unit 2. Analog vs. Digital. Analog vs. Digital. Binary Representation Systems ANALOG VS. DIGITAL

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

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

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

Number Systems Using and Converting Between Decimal, Binary, Octal and Hexadecimal Number Systems

Computer Architecture and System Software Lecture 02: Overview of Computer Systems & Start of Chapter 2

Excerpt from: Stephen H. Unger, The Essence of Logic Circuits, Second Ed., Wiley, 1997

Number Systems MA1S1. Tristan McLoughlin. November 27, 2013

Decimal Binary Conversion Decimal Binary Place Value = 13 (Base 10) becomes = 1101 (Base 2).

Chapter 3 DATA REPRESENTATION

Number System (Different Ways To Say How Many) Fall 2016

Lecture (03) Binary Codes Registers and Logic Gates

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

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

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

6. Binary and Hexadecimal

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

C How to Program, 6/e by Pearson Education, Inc. All Rights Reserved.

data within a computer system are stored in one of 2 physical states (hence the use of binary digits)

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

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

Electronics Engineering ECE / E & T

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

CS321. Introduction to Numerical Methods

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

Dec Hex Bin ORG ; ZERO. Introduction To Computing

Chapter 2 Binary Values and Number 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.

Transcription:

Lecture (01) Introduction Number Systems and Conversion (1) By: Dr. Ahmed ElShafee ١ Digital systems Digital systems are used in communication, business transactions, traffic control, spacecraft guidance, medical treatment, weather monitoring, the Internet, and many other commercial, industrial, and scientific enterprises Most, if not all, of these devices have a special purpose digital computer embedded within ٢ them.

These devices follow a sequence of instructions, called a program, that operates on given data. One characteristic of digital systems is their ability to represent and manipulate discrete elements of information. Any set that is restricted to a finite number of elements contains discrete information. ٣ Examples of discrete sets are the 10 decimal digits, the 26 letters of the alphabet, the 52 playing cards, and the 64 squares of a chessboard Discrete elements of information are represented in a digital system by physical quantities called signals. Electrical signals such as voltages and currents are the most common. ٤

electronic digital systems use just two discrete values and are therefore said to be binary. A binary digit, called a bit, has two values: 0 and 1. Discrete elements of information are represented with groups of bits called binary codes. For example, the decimal digits 0 through 9 are represented in a digital system with a code of four bits (e.g., the number 7 is represented by 0111). ٥ we could write (0111) 2 to indicate that the pattern 0111 is to be interpreted in a binary system, and (0111) 10 to indicate that the reference system is decimal. Then 0111 2 = 7 10, which is not the same as 0111 10, or one hundred eleven. ٦

Numbering systems A decimal number 7323 is a shorthand notation for what should be written as In general, a number with a decimal point is represented by a series of coefficients: The coeff nicients aj are any of the 10 digits (0, 1, 2,, 9), subscript value j gives the place value and, hence, the power of 10 by which the coefficient must be multiplied. a 3 = 7, a 2 = 3, a 1 = 9, and a 0 = 2. ٧ The decimal number system is said to be of base, or radix, 10 because it uses 10 digits and the coefficients are multiplied by powers of 10. ٨

The binary system The coefficients have only two possible values: 0 and 1. coefficient aj is multiplied by a power of the radix, e.g., 2 j, and the results are added to obtain the decimal equivalent of the number The radix (float) point distinguishes positive powers of 2 from negative powers of 2. 11010.11 2 = ٩ There are many different number system, number expressed in a base r system has coefficients multiplied by powers of r: stems, The coefficients aj range in value from 0 to r 1 ١٠

the conversion from binary to decimal can be obtained by adding only the numbers with powers of two corresponding to the bits that are equal to 1. For example, ١١ Other numbering systems An example of a base 5 number is The coefficient values for base 5 can be only 0, 1, 2, 3, and 4. An example of base 8 number (octal system) ١٢

hexadecimal (base 16) number system The letters of the alphabet are used to supplement the 10 decimal digits when the base of the number is greater than 10 The letters A, B, C, D, E, and F are used for the digits 10, 11, 12, 13, 14, and 15, respectively ١٣ Why the hexadecimal is important in computer systems? The hexadecimal system is used commonly by designers to represent long strings of bits in the addresses, instructions, and data in digital systems. For example, B65F is used to represent 1011011001010000 ١٤

Binary system prefixes: In computer work, 2 10 is referred to as K (kilo), 2 20 as M (mega), 2 30 as G (giga), and 2 40 as T (tera). 4K = 2 12 = 4,096 and 16M = 2 24 = 16,777,216. Computer capacity is usually given in bytes. A byte is equal to eight bits which presents a one keyboard character A computer hard disk with four gigabytes of storage has a capacity of 4G = 2 32 bytes A terabyte is 1024 gigabytes, = 2 40 ١٥ bytes. ١٦

Number base conversion Convert decimal 41 to binary First, 41 is divided by 2 to give an integer quotient of 20 and a remainder of 1/2. Then the quotient is again divided by 2 to give a new quotient and remainder. The process is continued until the integer quotient becomes 0. The coefficients of the desired binary number are obtained from the remainders as follows ١٧ ١٨

Example Convert decimal 153 to octal. The required base r is 8. First, 153 is divided by 8 to give an integer quotient of 19 and a remainder of 1. Then 19 is divided by 8 to give an integer quotient of 2 and a remainder of 3. Finally, 2 is divided by 8 to give a quotient of 0 and a remainder of 2. ١٩ quotient reminder Coefficient 153/8 19 1 a0=1 19/8 2 3 a1=3 2/8 0 2 a2=2 (153) 10 = (231) 8 ٢٠

Example Convert (0.6875) 10 to binary First, 0.6875 is multiplied by 2 to give an integer and a fraction. Then the new fraction is multiplied by 2 to give a new integer and a new fraction. The process is continued until the fraction becomes 0 or until the number of digits has sufficient accuracy. ٢١ Integer Fraction Coefficient 0.6875x2 1 0.3750 a 1 =1 0.3750x2 0 0.7500 a 2 =0 0.7500 x2 1 0.5000 a 3 =1 0.5000 x2 1 0.0000 a 4 =1 the answer is (0.6875) 10 = (0. a 1 a 2 a 3 a 4 ) 2 = (0.1011) 2. ٢٢

Example Convert (0.513)10 to octal. Integer Fraction Coefficient 0.513x8 4 0.104 a 1 =4 0.104x8 0 0.832 a 2 =0 0.832 x8 6 0.656 a 3 =6 0.656 x8 5 0.248 a 4 =5 0.248x8 1 0.984 a 5 =1 0.984 7 0.872 a 6 =7 (0.513) 10 = (0.406517.) 8 ٢٣ By combining previous examples: ٢٤

Octal and Hexadecimal numbers ٢٥ The conversion from and to binary, octal, and hexadecimal plays an important role in digital computers, because shorter patterns of hex characters are easier to recognize than long patterns 2 3 = 8 and 2 4 = 16, each octal digit corresponds to three binary digits and each hexadecimal digit corresponds to four binary digits. ٢٦

٢٧ The conversion from binary to octal partitioning the binary number into groups of three digits each, starting from the binary point and proceeding to the left and to the right. The corresponding octal digit is then assigned to each group. ٢٨

Conversion from binary to hexadecimal similar, except that the binary number is divided into groups of four digits: ٢٩ Conversion from octal to binary is done by reversing the preceding procedure. Each octal digit is converted to its three digit binary equivalent. ٣٠

Conversion from hexadecimal to binary is done by reversing the preceding procedure. each hexadecimal digit is converted to its four digit binary equivalent ٣١ that s why we need to use hex and octal, Easy conversion between binary octal, and binary hexadecimal, Binary numbers are difficult to work with because they require three or four times as many digits as their decimal equivalents. For example, the binary number 111111111111 is equivalent to decimal 4095. ٣٢

Thanks,.. See you next week (ISA), ٣٣