Decimal Number System We are used to the decimal number system which is a positional number system The decimal number 4386 represents the value: 41000.

Slides:



Advertisements
Similar presentations
Data Representation COE 202 Digital Logic Design Dr. Aiman El-Maleh
Advertisements

DATA REPRESENTATION CONVERSION.
Chapter 2 Binary Values and Number Systems Chapter Goals Distinguish among categories of numbers Describe positional notation Convert numbers in.
King Fahd University of Petroleum and Minerals
CS 151 Digital Systems Design Lecture 3 More Number Systems.
Level ISA3: Information Representation
Assembly Language and Computer Architecture Using C++ and Java
Chapter Chapter Goals Know the different types of numbers Describe positional notation.
Data Representation in Computers
Chapter 02 Binary Values and Number Systems Nell Dale & John Lewis.
ENGIN112 L3: More Number Systems September 8, 2003 ENGIN 112 Intro to Electrical and Computer Engineering Lecture 3 More Number Systems.
The Binary Number System
Converting Binary to Octal
Computer Systems 1 Fundamentals of Computing
Number System Review This section reviews binary numbers, hexadecimal numbers, and binary arithmetic © 2014 B. Wilkinson Modification date: Dec 29,
Binary Number Systems.
Dr. Bernard Chen Ph.D. University of Central Arkansas
Binary and Hexadecimal Numbers
Simple Data Type Representation and conversion of numbers
Lecture for Week Spring.  Numbers can be represented in many ways. We are familiar with the decimal system since it is most widely used in everyday.
CS105 INTRODUCTION TO COMPUTER CONCEPTS BINARY VALUES & NUMBER SYSTEMS Instructor: Cuong (Charlie) Pham.
Numeral Systems Subjects: Numeral System Positional systems Decimal
Numbering Systems CS208.
How Computers Work Dr. John P. Abraham Professor UTPA.
Numbering Systems. CSCE 1062 Outline What is a Numbering System Review of decimal numbering system Binary representation range Hexadecimal numbering system.
IT253: Computer Organization
ECEN2102 Digital Logic Design Lecture 1 Numbers Systems Abdullah Said Alkalbani University of Buraimi.
Chapter 2 Binary Values and Number Systems Chapter Goals Distinguish among categories of numbers Describe positional notation Convert numbers in.
Copyright 2005 Curt Hill Binary, Octal and Hexadecimal The number bases used in computers.
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.
Integer Representation for People Computer Organization and Assembly Language: Module 3.
CCE-EDUSAT SESSION FOR COMPUTER FUNDAMENTALS Date: Session III Topic: Number Systems Faculty: Anita Kanavalli Department of CSE M S Ramaiah.
Binary Values and Number Systems Chapter Goals Distinguish among categories of numbers Describe positional notation Convert numbers in other bases.
Number systems, Operations, and Codes
Binary Values and Number Systems
Positional Notation 642 in base 10 positional notation is:
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.
Chapter 2 Number Systems: Decimal, Binary, and Hex.
EEL 3801C EEL 3801 Part I Computing Basics. EEL 3801C Data Representation Digital computers are binary in nature. They operate only on 0’s and 1’s. Everything.
AEEE2031 Data Representation and Numbering Systems.
Number Systems by Dr. Amin Danial Asham. References  Programmable Controllers- Theory and Implementation, 2nd Edition, L.A. Bryan and E.A. Bryan.
Digital Fundamentals Tenth Edition Floyd Chapter 2 © 2008 Pearson Education.
Introduction To Number Systems Binary System M. AL-Towaileb1.
Chapter 2 Binary Values and Number Systems Chapter Goals Distinguish among categories of numbers Describe positional notation Convert numbers in.
1 Digital Logic Design Lecture 2 More Number Systems/Complements.
Number Systems. Topics  The Decimal Number System  The Binary Number System  Converting from Binary to Decimal  Converting from Decimal to Binary.
The Hexadecimal System is base 16. It is a shorthand method for representing the 8-bit bytes that are stored in the computer system. This system was chosen.
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.
Data Representation COE 308 Computer Architecture
Lecturer: Santokh Singh
Digital Design Chapter One Digital Systems and Binary Numbers
Data Representation ICS 233
Chapter 02 Nell Dale & John Lewis.
Number Systems and Binary Arithmetic
ITE102 – Computer Programming (C++)
Number Systems Give qualifications of instructors:
CSE 102 Introduction to Computer Engineering
Chapter 3 Data Representation
Fundamentals & Ethics of Information Systems IS 201
BEE1244 Digital System and Electronics BEE1244 Digital System and Electronic Chapter 2 Number Systems.
Data Representation COE 301 Computer Organization
MMNSS COLLEGE,KOTTIYAM DEPARTMENT OF PHYSICS
Data Representation in Computer Systems
Numbering System TODAY AND TOMORROW 11th Edition
Digital Electronics and Microprocessors
Number Systems.
Data Representation ICS 233
Data Representation COE 308 Computer Architecture
Presentation transcript:

Internal Information Representation and Processing CSCE 106 - Fundamentals of Computer Science Dr. Awad Khalil Computer Science & Engineering Department The American University in Cairo CSCI 532 - Contemporary Computer Design

Decimal Number System We are used to the decimal number system which is a positional number system The decimal number 4386 represents the value: 41000 + 3  100 + 8  10 + 6  1 In general, the decimal number dn dn-1 . . . d1 d0 represents the value: The digit at the left is called the most significant digit The most significant digit has the largest power of ten The digit at the right is called the least significant digit The concept of zero is a cornerstone in the decimal number system. It enables us to multiply by 10 by simply adding a zero as a least significant digit. Similarly, we can divide by zero by remove the least significant zero or inserting a decimal point. 1234  10 = 12340 1234 / 10 = 123.4 Internal Information Representation - slide 1 Fundamentals of Computer Science – Awad Khalil

Other Radices The positional number system is called also the Arabic number system (the Arabs have discovered the 0) Other bases (called also radices) are possible A digit in base b is between 0 and b-1 Base 10 digits: 0, 1, …, 9 (called also decimal digits) Base 2 digits: 0 and 1 (called also binary digits or bits) Base 3 digits: 0, 1, 2 Base 8 digits: 0, 1, …, 7 (called also octal digits) Base 16 digits: 0, 1, …, 9, A, B, C, D, E, F (called also hexadecimal digits) The number (dn dn-1 . . . d1 d0)b represents the value: Examples: (207)8 = 2  82 + 0  81 + 7  80 = 128 + 0 + 7 = 135 (1011)2 = 1  23 + 0  22 + 1  21 + 1  20 = 8 + 0 + 2 + 1 = 11 Internal Information Representation - slide 2 Fundamentals of Computer Science – Awad Khalil

Binary, Octal, and Hexadecimal Number Systems Computers use the binary number system Two binary digits: 0 and 1 called bits In the hardware circuitry, 0 represents LOW voltage, while 1 represents HIGH voltage Information inside the computer is represented by 0’s and 1’s The integer values 0 to 16, represented in four number systems are shown below: 0 0 0 0 1 1 1 1 2 10 2 2 3 11 3 3 4 100 4 4 5 101 5 5 6 110 6 6 7 111 7 7 8 1000 10 8 9 1001 11 9 10 1010 12 A 11 1011 13 B 12 1100 14 C 13 1101 15 D 14 1110 16 E 15 1111 17 F 16 10000 20 10 Decimal Binary Octal Hexadecimal Advantages of the octal and hexadecimal numbers: Reduce the length of numbers Are more readable than binary numbers Can be easily converted to/from binary Internal Information Representation - slide 3 Fundamentals of Computer Science – Awad Khalil

Conversions between Number Systems A number in base b can be easily converted to base 10 using the following equation: Examples: We can also convert a decimal number N to obtain the number (dn dn-1 . . . d1 d0 )b in base b using the following algorithm: (2012)3 = 2  33 + 0  32 + 1  31 + 2  30 = 54 + 0 + 3 + 2 = 59 (A0F)16 = 10  162 + 0  161 + 15  160 = 2560 + 0 + 15 = 2575 i := 0; q := N; repeat di := q mod b; q := q div b; i := i + 1; until q = 0; Question: Convert 50 to base 2 Answer: d0 = 50 mod 2 = 0, q = 50 div 2 = 25 d1 = 25 mod 2 = 1, q = 25 div 2 = 12 d2 = 12 mod 2 = 0, q = 12 div 2 = 6 d3 = 6 mod 2 = 0, q = 6 div 2 = 3 d4 = 3 mod 2 = 1, q = 3 div 2 = 1 d5 = 1 mod 2 = 1, q = 1 div 2 = 0 Thus, 50 = (110010)2 Question: Convert 50 to base 3 Answer: d0 = 50 mod 3 = 2, q = 50 div 3 = 16 d1 = 16 mod 3 = 1, q = 16 div 3 = 5 d2 = 5 mod 3 = 2, q = 5 div 3 = 1 d3 = 1 mod 3 = 1, q = 1 div 3 = 0 Thus, 50 = (1212)3 Internal Information Representation - slide 4 Fundamentals of Computer Science – Awad Khalil

More Conversions Answer: Suppose we want to convert a number from base 3 to base 2, we can convert it first to base 10 and then to base 2 Example: Convert (1012)3 to base 2 Answer: (1012)3 = 1  33 + 0  32 + 1  31 + 2  30 = 27 + 3 + 2 = 32 d0 = 32 mod 2 = 0, q = 32 div 2 = 16 d1 = 16 mod 2 = 0, q = 16 div 2 = 8 d2 = 8 mod 2 = 0, q = 8 div 2 = 4 d3 = 4 mod 2 = 0, q = 4 div 2 = 2 d4 = 2 mod 2 = 0, q = 2 div 2 = 1 d5 = 1 mod 2 = 1, q = 1 div 2 = 0 Thus, (1012)3 = 32 = (100000)2 It is easy to convert numbers between the binary, octal, and hexadecimal systems Every 3 binary digits can be converted into an octal digit starting at the least significant bit Every 4 binary digits can be converted into a hexadecimal digit Example: (10100110)2 = (246)8 = (A6)16 Internal Information Representation - slide 5 Fundamentals of Computer Science – Awad Khalil

Computer Representation of Information Basic unit of information is the Bit or Binary digit. With a single bit, we can represent two distinct values 0 and 1. With two bits, we can represent four distinct values: 00, 01, 10, and 11. In general, with m bits, we can represent 2m distinct values. A byte is a grouping of 8 bits. A word is a grouping of either 16, 32, or 64 bits, depending on the computer system. A word is typically 32 bits on most systems, a half word is 16 bits, and a double word is 64 bits. Bit = 0 or 1 Byte = 8 bits Half Word = 2 bytes = 16 bits Word = 4 bytes = 32 bits Long Word = 8 bytes = 64 bits Internal Information Representation - slide 6 Fundamentals of Computer Science – Awad Khalil

Binary Addition The addition of 3 bits a + b + c produces a sum bit and a carry bit. Signed Integers are represented in 2’s complement notation. Addition of integers in 2’s complement notation results in a signed integer. Although a carry out is produced in the 2nd and 4th computations, it is ignored. Examples: carry  11110 carry  111011000 01001101 +77 11101101 –19 + 00101011 +43 + 10101110 –82 sum  01111000 +120 sum  10011011 –101 11001101 –51 01101101 +109 sum  11111000 –8 sum  00011011 +27 a b c carry sum 0 0 0 0 0 0 0 1 0 1 0 1 0 0 1 0 1 1 1 0 1 0 0 0 1 1 0 1 1 0 1 1 0 1 0 1 1 1 1 1 a + b + c Internal Information Representation - slide 7 Fundamentals of Computer Science – Awad Khalil

The Discipline of Computing Computing is a relatively young academic discipline. We distinguish between applications of the computer within other disciplines such as business, engineering, and sciences, and the nature of computing itself. Peter Denning gave the following broad definition of the field of Computer Science: Computer Science is the body of knowledge dealing with the design, analysis, implementation, efficiency, and application of processes that transform information. The fundamental question underlying all of computer science is "what can be automated?" Nine general subject areas combine to make up the discipline of Computing. These are shown below: Internal Information Representation - slide 8 Fundamentals of Computer Science – Awad Khalil

The Discipline of Computing Internal Information Representation - slide 9 Fundamentals of Computer Science – Awad Khalil