Lecture 3: Binary values and number systems

Slides:



Advertisements
Similar presentations
DATA REPRESENTATION CONVERSION.
Advertisements

James Tam Beyond base 10: Non-decimal based number system What exactly is decimal? How do other number systems work (binary, octal and hex) How to convert.
Chapter 2 Binary Values and Number Systems Chapter Goals Distinguish among categories of numbers Describe positional notation Convert numbers in.
Chapter Chapter Goals Know the different types of numbers Describe positional notation.
Chapter 02 Binary Values and Number Systems Nell Dale & John Lewis.
The Binary Number System
Converting Binary to Octal
Number Systems and Arithmetic
 Binary Binary  Binary Number System Binary Number System  Binary to Decimal Binary to Decimal  Decimal to Binary Decimal to Binary  Octal and Hexadecimal.
Numbering Systems Decimal (Denary) base 10. Clumsy when dealing with computers. Other systems –Binary –Octal –Hexadecimal Convenient when dealing with.
Hexadecimal Dk Izzati Pg Haji Ahmad.
Number Systems.
CS105 INTRODUCTION TO COMPUTER CONCEPTS BINARY VALUES & NUMBER SYSTEMS Instructor: Cuong (Charlie) Pham.
Numeral Systems Subjects: Numeral System Positional systems Decimal
How Computers Work Dr. John P. Abraham Professor UTPA.
Chapter 2 Binary Values and Number Systems Chapter Goals Distinguish among categories of numbers Describe positional notation Convert numbers in.
The Wonders of Conversion. A number system is a system in which a number is represented. There are potential infinite number systems that can exist (there.
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,
1 Week 2: Binary, Octal and Hexadecimal Numbers READING: Chapter 2.
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:
Number Base Conversions
Digital Electronics Octal & Hexadecimal Number Systems.
CISC1100: Binary Numbers Fall 2014, Dr. Zhang 1. Numeral System 2  A way for expressing numbers, using symbols in a consistent manner.  " 11 " can be.
1 Data Representation Characters, Integers and Real Numbers Binary Number System Octal Number System Hexadecimal Number System Powered by DeSiaMore.
Chapter 2 Data Representation.
Number System sneha.
Chapter 2 Number Systems: Decimal, Binary, and Hex.
Octal to Decimal Hexadecimal DecimalOctal Binary.
CSC 107 – Programming For Science. Positional Notation  Used in nearly all modern numerical systems  Right-to-left ordering of digits within larger.
Binary01.ppt Decimal Decimal: Base 10 means 10 Unique numerical digits ,00010,000 Weight Positions 3,
PHY 107 – Programming For Science. Positional Notation  Used in nearly all modern numerical systems  Right-to-left ordering of digits within larger.
Octal & Hexadecimal Number Systems
1 CS151 Introduction to Digital Design Chapter 1 Lecture 3.
Chapter 2 Binary Values and Number Systems Chapter Goals Distinguish among categories of numbers Describe positional notation Convert numbers in.
ECE 362 Microprocessor Systems and Interfacing ©5-1 Lecture 1 Hexadecimal Computation Outline n Decimal n Binary n Octal n Hexadecimal.
Cis303a_chapt03_exam1_answer.ppt CIS303A: System Architecture Exam 1: Chapter 3 Answer List the characters (digits) for the following bases. 1) Decimal:
CS151 Introduction to Digital Design Chapter 1: Digital Systems and Information Lecture 2 1Created by: Ms.Amany AlSaleh.
CSC 110 – Intro to Computing Lecture 3: Converting between bases & Arithmetic in other bases.
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.
Chapter 01 Numbers. Chapter 02 Base 10 example Decimal Number Place Place (place - 1) ===============================
Binary Values. Numbers Natural Numbers Zero and any number obtained by repeatedly adding one to it. Examples: 100, 0, 45645, 32 Negative Numbers.
Prepared By: Norakmar Binti Mohd Nadzari CHAPTER 2 ARITHMETIC AND LOGIC UNIT.
Binary Values and Number Systems
Digital Design Chapter One Digital Systems and Binary Numbers
Chapter 02 Nell Dale & John Lewis.
Octal to Decimal Decimal Octal Binary Hexadecimal.
Discrete Mathematics Numbering System.
What is a byte? What is it? How would you use it?
Integer Real Numbers Character Boolean Memory Address CPU Data Types
Base ‘b’ number for i = 0 to n – 1 for an n digit quantity
Chapter 3 Data Representation
2.0 COMPUTER SYSTEM 2.2 Number System and Representation
Tools of Web Development 1: Module A: Numbering Systems
Number System conversions
Number Systems and Binary Arithmetic
Introduction to IT By: Muhammed s. anwar.
Textbook Computer Science Illuminated 4th Edition  By Nell Dale, John Lewis - Jones and Bartlett Publishers 11/20/2018.
Numbering System TODAY AND TOMORROW 11th Edition
Digital Electronics and Microprocessors
Binary Values and Number Systems
Chapter Four Data Representation in Computers By Bezawit E.
Binary Values and Number Systems
Information Representation
Chapter 2 Number System.
Binary Values and Number Systems
1. Number Systems Chapt. 2.
Presentation transcript:

Lecture 3: Binary values and number systems Information Layer Lecture 3: Binary values and number systems

Layers of Computing Systems Communications Applications Operating Systems Programming Hardware Information

Information Information Layer 01001010101010 numbers audio text Images video 01001010101010

Binary values and number systems Numbers and Computing Positional notation Binary, Octal and Hexadecimal Arithmetic in other bases Power of 2 Number Systems Converting from base 10 to other bases Binary values and computers

Numbers and Computing Computer executes numeric computations All types of information that is stored on a computer is stored as numbers (0s and 1s) Number – unit belonging to an abstract mathematical system and is a subject to specified laws of succession, addition and multiplication

Positional notation How many ones are there in 943? The answer depends on base  Base of a number system specifies the number of digits used in the system. Digits always begin with 0 and continue through one less than the base Eg. Base 10: has digits from 0 to 9

Base 10 (decimal) Base 2 (binary) Base 8 (octal) Base 16 (hexadecimal) 1 2 10 3 11 4 100 5 101 6 110 7 111 8 1000 9 1001 1010 12 A 1011 13 B 1100 14 C 1101 15 D 1110 16 E 1111 17 F 11000 20

Positional notation The rightmost digit represents its value multiplied by the base to the zeroth power, the digit to the left represents its value multiplied by the base to the first power Number 943 demystified: 9 4 3 9*102 4*101 3*10 0 900 40 943

9*x2+4*x1+3*x0 Formal notation If a number in the base R number system has n digits, it is represented as follows, where di represents the digit in the ith position in the number dn*Rn-1+dn-1*Rn-2+...+d2*R+d1

dn*Rn-1+dn-1*Rn-2+...+d2*R+d1 Decompose number 2458 using the formula above You can also use 9 4 3 9*102 4*101 3*10 0 900 40 943

Why? Why would you need to represent values in base 2? 8? 13? 45???

binary to decimal To convert a number from binary to base 10, just break the number into a sum of numbers from the above list. Example: Convert 100112 to base 10 100112 = 100002 + 102 + 1 = 16 + 2 + 1 = 1910 100002 = 16 + 102 = 2 12 = 1 ---------------- 1910

Decimal to other bases While (the quotient is not zero) Divide the decimal number by the new base Make the remainder the next digit to the left of the answer Replace the decimal number with the quotient

Decimal to other bases Remainder 12 11 1 C B A - ABC

Binary to octal To convert from binary to octal, you start at the rightmost binary digit and mark the digits in groups of threes. Then you convert each group of three to its octal value. E.g. 1010110

Binary to hexadecimal mark digits from right to left in groups of four. 1010110

Arithmetic in other bases Basic addition in decimal (base 10) 0+1=1 1+1=2 2+1=3 9+1=10 Because there is no symbol for 10, we reuse same digits and rely on position. The rightmost digit reverts to 0 and there is a carry into next position to the left

Octal to decimal (1336)8 = (1 x 83) + (3 x 82) + (3 x 81) + (6 x 80) = (1 x 512) + (3 x 64) + (3 x 8) + (6 x 1) = 512 + 192 + 24 + 6 = 734 Thus (1336)8 = (734)10

Octal to binary  look up each octal digit to obtain the equivalent group of three binary digits. Octal  = 3 4 5 Binary = 011 100 101 = 011100101 binary

Octal to hex When converting from octal to hexadecimal, it is often easier to first convert the octal number into binary and then from binary into hexadecimal. For example, to convert 345 octal into hex: Octal  = 3 4 5 Binary = 011 100 101 = 011100101 binary

Octal to hex Drop any leading zeros or pad with leading zeros to get groups of four binary digits (bits): Binary 011100101 = 1110 0101 Then, look up the groups in a table to convert to hexadecimal digits.