Lecture 2 Bits, Bytes & Number systems

Slides:



Advertisements
Similar presentations
DATA REPRESENTATION CONVERSION.
Advertisements

CS 151 Digital Systems Design Lecture 3 More Number Systems.
Level ISA3: Information Representation
Chapter 4.2 Binary numbers: Arithmetic
ENGIN112 L3: More Number Systems September 8, 2003 ENGIN 112 Intro to Electrical and Computer Engineering Lecture 3 More Number Systems.
1 Number Systems. 2 Numbers Each number system is associated with a base or radix – The decimal number system is said to be of base or radix 10 A number.
Computer Systems 1 Fundamentals of Computing
Number Systems and Arithmetic
© 2010 Kettering University, All rights reserved..
 Binary Binary  Binary Number System Binary Number System  Binary to Decimal Binary to Decimal  Decimal to Binary Decimal to Binary  Octal and Hexadecimal.
Binary Numbers.
ACOE1611 Data Representation and Numbering Systems Dr. Costas Kyriacou and Dr. Konstantinos Tatas.
Numbering systems.
Numeral Systems Subjects: Numeral System Positional systems Decimal
Chapter 3 Data Representation
ECEN2102 Digital Logic Design Lecture 1 Numbers Systems Abdullah Said Alkalbani University of Buraimi.
Data Representation in Computer Systems. 2 Objectives Understand the fundamentals of numerical data representation and manipulation in digital computers.
CCE-EDUSAT SESSION FOR COMPUTER FUNDAMENTALS Date: Session III Topic: Number Systems Faculty: Anita Kanavalli Department of CSE M S Ramaiah.
Number systems, Operations, and Codes
Digital Logic Lecture 2 Number Systems
CMSC 104, Lecture 051 Binary / Hex Binary and Hex The number systems of Computer Science.
Positional Notation 642 in base 10 positional notation is:
ECE456: Number Systems (review)
Microcomputers I - Electrical and Computer Engineering Dept. at Kettering.
Conversions Denary to Binary Method 1
CS 101 – Aug. 31 Interpreting binary  decimal √ Decimal  binary Shorthand ways of expressing binary –Octal –“Hex” Negative numbers.
AEEE2031 Data Representation and Numbering Systems.
Lecture 1: 8/27/2002CS170 Fall CS170 Computer Organization and Architecture I Ayman Abdel-Hamid Department of Computer Science Old Dominion University.
Announcement!!! First exam next Thursday (I’m trying to give you a first exam before the drop date) I’ll post a sample exam over the weekend and will try.
Computer Number System
Chapter 1 Number Systems Digital Electronics. Topics discussed in last lecture Digital systems Advantages of using digital signals over analog. Disadvantages.
ABFC... Home page Introduction Binary number system Hexadecimal number system Binary coded decimal Objectives Octal number system Click.
ECE DIGITAL LOGIC LECTURE 2: DIGITAL COMPUTER AND NUMBER SYSTEMS Assistant Prof. Fareena Saqib Florida Institute of Technology Fall 2016, 01/14/2016.
CS151 Introduction to Digital Design Chapter 1: Digital Systems and Information Lecture 2 1Created by: Ms.Amany AlSaleh.
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 and Binary Arithmetic Quantitative Analysis II Professor Bob Orr.
Conversions 1)Binary to Denary Method 1 Work out the position values of the binary bits and add those values together So above would be
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.
Some basic concepts underlying computer archi­tecture
Binary & Hex Review.
Unit 2.6 Data Representation Lesson 1 ‒ Numbers
Different Numeral Systems
1. Number Systems.
NUMBER SYSTEM Prepared by: Engr Zakria.
Number System.
By: Jonathan O. Cabriana
Digital Electronics INTRODUCTION ANALOG VS DIGITAL NUMBER SYSTEMS.
Number Systems.
Convert Decimal to Binary
Chapter 3 Data Representation
2.0 COMPUTER SYSTEM 2.2 Number System and Representation
Number System conversions
BEE1244 Digital System and Electronics BEE1244 Digital System and Electronic Chapter 2 Number Systems.
Number Systems and Binary Arithmetic
Introduction to IT By: Muhammed s. anwar.
Dr. Clincy Professor of CS
Unit 2.6 Data Representation Lesson 1 ‒ Numbers
Hexadecimal Conversions
Numbering System TODAY AND TOMORROW 11th Edition
Numbering Systems and Arithmetic operations on Hex, binary, and octal
Digital Electronics and Microprocessors
(return of the…) Data blast
Number Systems.
Chapter Four Data Representation in Computers By Bezawit E.
Number Systems created by: S.Shahrukh haider
Number Systems Rayat Shikshan Sanstha’s
Numeral systems (radix)
Number Systems Rayat Shikshan Sanstha’s
Binary & Hex Review.
Presentation transcript:

Lecture 2 Bits, Bytes & Number systems

Representation of Numbers Different ways to say “how many”… Human: decimal number system Radix-10 or base-10 Base-10 means that a digit can have one of ten possible values 0 through 9. Computer: binary number system Radix-2 or base-2 Why binary? Each digit can have one of two values 0 or 1

Bits and Bytes A binary digit is a single numeral in a binary number. Each 1 and 0 in the number below is a binary digit: 1 0 0 1 0 1 0 1 The term “binary digit” is commonly called a “bit.” Eight bits grouped together is called a “byte.”

Relationship between Decimal & Binary Background: Number systems are positional There are 10 symbols that represent decimal quantities Multi-digit numbers are interpreted as in the following example 79310 = 7 x 100 + 9 x 10 + 3 = 7 x 102 + 9 x 101 + 3 x 100 Each place value in a decimal number is a power of 10. We can get a general form of this ABCbase A x (base)2 + B x (base)1 + C x (base) 0 Remember that the position index starts from 0. Indicate positions

Relationship between Decimal & Binary Binary numbers are represented using the digits 0 and 1. Multi-digit numbers are interpreted as in the following example 101112 = 1 x 24 + 0 x 23 + 1 x 22 + 1 x 21 + 1 x 20 = 1 x 16 + 0 x 8 + 1 x 4 + 1 x 2 + 1 x 1 Each place value in a binary number is a power of 2.

Converting binary numbers to decimal Step 1: Starting with the 1’s place, write the binary place value over each digit in the binary number being converted. Step 2: Add up all of the place values that have a “1” in them. Interpret the binary number 101012 in decimal TRY: Interpret the binary number 010101102 in decimal

Converting decimal numbers to binary We have now learnt how to convert from binary to decimal Using positional representation But how about decimal to binary Repeated division method Simply keep dividing it by 2 and record the remainder Repeat above step as many times as necessary until you get a quotient that can’ t be divided by 2 Remainders give the binary digits, starting from the last remainder Let’s look at some examples…

Converting decimal numbers to binary Let’s convert decimal 23 to binary. Step 1: 23/2 = 11 remainder 1 Step 2: 11/2 = 5 remainder 1 Step 3: 5/2 = 2 remainder 1 Step 4: 2/2 = 1 remainder 0 The last quotient “1” cannot be divided by 2 any more. So the process ends. The final binary number is read from the very end including the last quotient: 1 0 1 1 1 Try: Convert decimal 73, 96, 127, 128 to binary.

Hexadecimal Computers use binary number system because of the electric voltage (high or low voltage) Very difficult to express for large number representation Hexadecimal to rescue Hexadecimal system is interface between human brain and computer brain 4 bits from binary are read together and represented using a single digit Such 4-bits are known as nibble This gives a total of 16 different options The hexadecimal number system is a Base-16 number system: There are 16 symbols that represent quantities: Represented by the symbols 0-9 and A-F where the letters represent values: A=10, B=11, C=12, D=13, E=14, and F=15

Numbering systems Decimal Hexadecimal Binary 0000 1 0001 2 0010 3 0011 4 0100 5 0101 6 0110 7 0111 Decimal Hexadecimal Binary 8 1000 9 1001 10 A 1010 11 B 1011 12 C 1100 13 D 1101 14 E 1110 15 F 1111

Hexadecimal Thus each byte is two hex digits (shorthand representation for human) EX: Binary: 110010102 How to represent this in hex representation? 110010102 Separate them into nibbles 1100 1010 C A Hexadecimal representation: CA16 Try: convert 11110101101011002 to Hex representation

Converting Hex number to Binary Converting hexadecimal numbers to binary is just the reverse operation of converting binary to hexadecimal. Just convert each hexadecimal digit to its four-bit binary pattern. The resulting set of 1s and 0s is the binary equivalent of the hexadecimal number. Convert A5B916 to Binary.

Conversion: Hex and decimal Hex to decimal Exact similar to binary to decimal Use base 16 Try CA16 Decimal to Hex Exactly similar to decimal to binary Divide by 16 Try 20210

Notes on Bases Subscript is mandatory at least for a while. We use all three number bases. When a number is written, you should include the correct subscript. Pronunciation Binary and hexadecimal numbers are spoken by naming the digits followed by “binary” or “hexadecimal.”

Ranges of Number Systems Lowest Highest Number of values 4-bit binary (1-digit hex) 00002 010 016 11112 1510 F16 1610 8-bit binary (2-digit hex) 0000 00002 0016 1111 11112 25510 FF16 25610 16-bit binary (4-digit hex) 0000 0000 0000 00002 000016 1111 1111 1111 11112 6553510 FFFF16 6553610 Ranges of Unsigned Number Systems

Electronic Prefixes There is a set of terms used in electronics to represent very large values and very small values. Kilo, Mega, Giga, Tera – used for representing very large values E.g., KiloByte, MegaByte etc. milli, micro, nano, pico – used for representing very small values E.g., milliseconds, microseconds etc.

Reading assignment In Blackboard: reading02_08_29_2012.pdf

Practice problems Let us do some quick example problems …