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

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

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

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

Korea University of Technology and Education

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

MC1601 Computer Organization

Electronic Data and Instructions

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

CS & IT Conversions. Magnitude 10,000 1,

EEM 232 Digital System I

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

Digital Systems and Binary Numbers

Digital Systems and Binary Numbers

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

ITEC 1011 Introduction to Information Technologies

Level ISA3: Information Representation

Number representations

CHW 261: Logic Design

CMPS 10 Introduction to Computer Science Lecture Notes

Fundamentals of Programming (C)

Number Systems CHAPTER Positional Number Systems

Introduction to Numbering Systems

CMPE223/CMSE222 Digital Logic Design. Positional representation

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

Chapter 1 Review of Number Systems

Digital Fundamentals

3.1. Unit 3. Binary Representation

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

What Is It? Instruction Register Address Register Data Register

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

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

Objectives. Connecting with Computer Science 2

Lecture 1: Digital Systems and Number Systems

CHAPTER 2 Number Systems

Chap 1. Digital Computers and Information

Chapter 1 Emad Felemban

LOGIC DESIGN. Dr. Mahmoud Abo_elfetouh

DIGITAL SYSTEM DESIGN

2 Number Systems 2.1. Foundations of Computer Science Cengage Learning

Information Science 1

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

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.

10.1. Unit 10. Signed Representation Systems Binary Arithmetic

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

Binary. Hexadecimal BINARY CODED DECIMAL

in this web service Cambridge University Press

EE 109 Unit 2. Binary Representation Systems

1.1. Unit 1. Integer Representation

MACHINE LEVEL REPRESENTATION OF DATA

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

Lecture 1: What is a computer?

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

TOPIC: NUMBER SYSTEMS

Lecture 2: Number Systems

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

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

The. Binary. Number System

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

Final Labs and Tutors

Introduction to Computers and Programming. Numeric Values

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

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

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

Computer Number Systems Supplement

Octal & Hexadecimal Number Systems. Digital Electronics

Lecture (03) Binary Codes Registers and Logic Gates

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

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

6. Binary and Hexadecimal

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

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

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

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

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

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

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

Chapter 2 Binary Values and Number Systems

COMP Overview of Tutorial #2

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

CS321. Introduction to Numerical Methods

Electronics Engineering ECE / E & T

Floating-point Arithmetic. where you sum up the integer to the left of the decimal point and the fraction to the right.

Homework 1 graded and returned in class today. Solutions posted online. Request regrades by next class period. Question 10 treated as extra credit

Lecture (02) Operations on numbering systems

Dec Hex Bin ORG ; ZERO. Introduction To Computing

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

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

Chapter 2 Exercises and Answers

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.

Number Systems MA1S1. Tristan McLoughlin. November 27, 2013

Module 1: Information Representation I -- Number Systems

Transcription:

١ Lecture (01) Digital Systems and Binary Numbers 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 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 coefficients aj are any of the 10 digits (0, 1, 2, c, 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 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 Arithmetic operations 1010001 +1000101 -------------- 10010110 A computer hard disk with four gigabytes of storage has a capacity of 4G = 2 32 bytes ١٥ A terabyte is 1024 gigabytes, = 240 bytes. ١٦

1010001-1000101 --------------- 0001100 ١٧ ١٨ Number base conversion Convert decimal 41 to binary 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. ٢١ ٢٢ Example 153/8 19/8 2/8 (153) 10 = (231) 8 quotient 19 2 0 + + + reminder 1 3 2 Coefficient a0=1 a1=3 a2=2 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. ٢٣ ٢٤

Example 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. Convert (0.513)10 to octal. Integer Fraction 0.513x8 4 + 0.104 0.104x8 0 + 0.832 0.832 x8 6 + 0.656 0.656 x8 5 + 0.248 0.248x8 1 + 0.984 0.984 7 0.872 Coefficient a 1 =4 a 2 =0 a 3 =6 a 4 =5 a 5 =1 a 6 =7 (0.513) 10 = (0.406517.) 8 ٢٥ ٢٦ Octal and Hexadecimal numbers By combining previous examples: 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), ٣٥