 Binary Binary  Binary Number System Binary Number System  Binary to Decimal Binary to Decimal  Decimal to Binary Decimal to Binary  Octal and Hexadecimal.

Slides:



Advertisements
Similar presentations
DATA REPRESENTATION CONVERSION.
Advertisements

CIS 020 Assembly Programming Chapter 02 - Numbering Systems & Data Representation © John Urrutia 2012, All Rights Reserved.5/27/20121.
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.
1 Section 2.5 Integers and Algorithms. 2 Euclidean algorithm for finding gcd Where L is a larger number, and S is a smaller number, to find gcd(L,S):
Number System Conversions Lecture L2.2 Section 2.3.
Richard P. Paul, SPARC Architecture, Assembly Language Programming, and C Chapter 3 – Digital Logic and Binary Numbers These are lecture notes to accompany.
Converting Binary to Octal
Number Systems and Arithmetic
Binary Numbers.
Number systems Converting numbers between binary, octal, decimal, hexadecimal (the easy way)
Page 1 Data Structures in C for Non-Computer Science Majors Kirs and Pflughoeft Basic Data Types Note that the methods we used to convert from decimal.
Data Representation in Computers. Data Representation in Computers/Session 3 / 2 of 33 Number systems  The additive approach – Number earlier consisted.
Numbering Systems Decimal (Denary) base 10. Clumsy when dealing with computers. Other systems –Binary –Octal –Hexadecimal Convenient when dealing with.
Binary and Hexadecimal Numbers
Number Systems.
Numeral Systems Subjects: Numeral System Positional systems Decimal
Numbering Systems CS208.
Number systems: binary, decimal, hexadecimal and octal. Conversion between various number systems Number systems: binary, decimal, hexadecimal and octal.
Lecture 4 Last Lecture –Positional Numbering Systems –Converting Between Bases Today’s Topics –Signed Integer Representation Signed magnitude One’s complement.
Number systems, Operations, and Codes
Numbering System Base Conversion. Number systems Decimal – 0, 1, 2, 3, 4, 5, 6, 7, 8, 9 Binary – 0, 1 Octal – 0, 1, 2, 3, 4, 5, 6, 7 Hexadecimal system.
Number Base Conversions
Digital Electronics Octal & Hexadecimal Number Systems.
Introduction to Number System
Octal to Decimal Hexadecimal DecimalOctal Binary.
Positional Number Systems Decimal, Binary, Octal and Hexadecimal Numbers Wakerly Section
AEEE2031 Data Representation and Numbering Systems.
DECIMALBINARY a) b) c) d) e) f) Revision Exercise DECIMALBINARY a) b) c)
Binary01.ppt Decimal Decimal: Base 10 means 10 Unique numerical digits ,00010,000 Weight Positions 3,
Octal & Hexadecimal Number Systems
Chapter 1 Number Systems Digital Electronics. Topics discussed in last lecture Digital systems Advantages of using digital signals over analog. Disadvantages.
CSC 3210 Computer Organization and Programming
Number Systems. Topics  The Decimal Number System  The Binary Number System  Converting from Binary to Decimal  Converting from Decimal to Binary.
ECE 2110: Introduction to Digital Systems Number Systems: conversions.
ECE DIGITAL LOGIC LECTURE 2: DIGITAL COMPUTER AND NUMBER SYSTEMS Assistant Prof. Fareena Saqib Florida Institute of Technology Fall 2016, 01/14/2016.
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 32 Binary Number System. Objectives After completing this chapter, you will be able to: –Describe the binary number system –Identify the place.
ECE 2110: Introduction to Digital Systems Number Systems: conversions.
Computer Maintenance Numbering Systems Copyright © Texas Education Agency, All rights reserved.1.
1. Binary, Decimal, Hexadecimal and Octal. 2. Conversion between various number systems. Number Systems:
Introduction To Number Systems
Positional Number Systems Decimal, Binary, Octal and Hexadecimal Numbers Wakerly Section
Digital Design Chapter One Digital Systems and Binary Numbers
Octal to Decimal Decimal Octal Binary Hexadecimal.
Discrete Mathematics Numbering System.
By: Jonathan O. Cabriana
Lecture 3: Binary values and number systems
Convert Decimal to Binary
CSE 102 Introduction to Computer Engineering
Location in course textbook
Tools of Web Development 1: Module A: Numbering Systems
Chapter 3 – Digital Logic and Binary Numbers
Number System conversions
University of Gujrat Department of Computer Science
Chapter 1 Number Systems & Conversions
Data Storage Introduction to computer, 2nd semester, 2010/2011
Binary Quiz UIN: ____________________
Introduction to IT By: Muhammed s. anwar.
Unit 2.6 Data Representation Lesson 1 ‒ Numbers
Digital Electronics and Microprocessors
Chapter 2: Number Systems
Numeral systems (radix)
Decimal / Binary Conversions
Beyond Base 10: Non-decimal Based Number Systems
COMS 161 Introduction to Computing
Number systems Converting numbers between binary, octal, decimal, hexadecimal (the easy way)
1. Number Systems Chapt. 2.
Dr. Clincy Professor of CS
Presentation transcript:

 Binary Binary  Binary Number System Binary Number System  Binary to Decimal Binary to Decimal  Decimal to Binary Decimal to Binary  Octal and Hexadecimal Octal and Hexadecimal  Binary to Hexadecimal Binary to Hexadecimal  Hexadecimal to Binary Hexadecimal to Binary  Hexadecimal to Decimal Hexadecimal to Decimal  Any Number Base to Decimal Any Number Base to Decimal  Decimal to Any Number Base Decimal to Any Number Base  Binary Coded Decimal (BCD) Binary Coded Decimal (BCD)

 A computer is a “bistable” device  A bistable device: ◦ Easy to design and build ◦ Has 2 states: 0 and 1  One Binary digit (bit) represents 2 possible states (0, 1)

 With 2 bits, 4 states are possible (2 2 = 4) With n bits, 2 n states are possible With 3 bits, 8 states are possible (2 3 = 8) Bit 1 Bit 0 State Bit 2 Bit 1 Bit 0 State Go back

 From left to right, the position of the digit indicates its magnitude (in decreasing order) ◦ E.g. in decimal, 123 is less than 321 ◦ In binary, 011 is less than 100  A subscript indicates the number’s base ◦ E.g. is 100 decimal or binary? We don’t know! ◦ But = is clear Go back

 Binary is base 2  Example: convert (binary) to decimal = 1x x x x x2 0 = 1x16 + 0x8 + 1x4 + 1x2 + 0x1 = =22  So = Go back

 Binary is base 2  Example: convert 35 (decimal) to binary QuotientRemainder 35 / 2 = / 2 = 81 8 / 2 = 40 4 / 2 = 20 2 / 2 = 10 1 / 2 = 01  So = Go back

 It is difficult for a human to work with long strings of 0’s and 1’s  Octal and Hexadecimal are ways to group bits together  Octal: base 8  Hexadecimal: base 16

 With 4 bits, there are 16 possibilities  Use 0, 1, 2, 3, …9 for the first 10 symbols  Use a, b, c, d, e, and f for the last 6 Bit 3 Bit 2 Bit 1 Bit 0 Symbol a 101 1b 110 0c 110 1d 111 0e 111 1f Go back

 = ? in hex  Group into 4 bits, from the right:  0101, 0110, 1011,  Now translate each (see previous table): => 5, => 6, => b, => 3 So this is 56b3 16  What if there are not enough bits? ◦ Pad with 0’s on the left Go back

f0e5 16 = ? in binary Translate each into a group of 4 bits: f 16 => , 0 16 => , e 16 => , 5 16 => So this is Go back

 Hexadecimal is base 16  Example: convert 16 (hex) to decimal = 1x x16 0 = 1x16 + 6x1 = =22  So =  Not surprising, since = 0001, ◦ If one of the hex digits had been > 9, say c, then we would have used 12 in its place. Go back

 From right to left, multiply the digit of the number-to-convert by its base position  Sum all results Go back

 Take the decimal number, and divide by the new number base  Keep track of the quotient and remainder  Repeat until quotient = 0  Read number from the bottom to the top Go back

 Why not use 4 bits to represent decimal?  Let 0000 represent 0  Let 0001 represent 1  Let 0010 represent 2  Let 0011 represent 3, etc. ◦ This is called BCD ◦ Only uses 10 of the 16 possibilities Go back