Number Systems. ASCII – American Standard Code for Information Interchange – Standard encoding scheme used to represent characters in binary format on.

Slides:



Advertisements
Similar presentations
Number SystemsNumber Systems Modified By: AM. Sihan (Hardware Engineering)
Advertisements

Chapter Chapter Goals Know the different types of numbers Describe positional notation.
VIT UNIVERSITY1 ECE 103 DIGITAL LOGIC DESIGN CHAPTER I NUMBER SYSTEMS AND CODES Reference: M. Morris Mano & Michael D. Ciletti, "Digital Design", Fourth.
ITEC 1011 Introduction to Information Technologies 1. Number Systems Chapt. 2 Location in course textbook.
2.1 2 Number Systems Foundations of Computer Science  Cengage Learning.
Prepared By Rama Gaikwad 1. Number Systems. Common Number Systems SystemBaseSymbols Used by humans? Used in computers? Decimal100, 1, … 9YesNo Binary20,
Dr. Bernard Chen Ph.D. University of Central Arkansas
Simple Data Type Representation and conversion of numbers
Lecture 7 How computers process data (Number Systems) PRESENTED BY MD. MAHBUBUL ALAM, PHD 1.
Fundamentals of IT UNIT-I OnlyforIPMCA. DIGITAL SIGNALS & LOGIC GATES Signals and data are classified as analog or digital. Analog refers to something.
Introduction to Computer Science Number Systems. Introduction to Computer Science Common Number Systems SystemBaseSymbols Used by humans? Used in computers?
Chapter 3 Data Representation
ECEN2102 Digital Logic Design Lecture 1 Numbers Systems Abdullah Said Alkalbani University of Buraimi.
Conversion of Number System Conversion Among Bases The possibilities: Hexadecimal DecimalOctal Binary
IT101: INFORMATION TECHNOLOGY FUNDAMENTALS 1 Edited By Dr. Ahmed Abo-Bakr Information Technology Dept. Faculty of Computers & Information.
NUMBER SYSTEMS Prepared By K.Anitha Associate Professor Dept of ECE PVPSIT.
1 DLD Lecture 18 Recap. 2 Recap °Number System/Inter-conversion, Complements °Boolean Algebra °More Logic Functions: NAND, NOR, XOR °Minimization with.
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 Systems Architecture Copyright © Genetic Computer School 2008 CSA 1- 0 Lesson 1 Number System.
Number Systems Ron Christensen CIS 121.
CCE-EDUSAT SESSION FOR COMPUTER FUNDAMENTALS Date: Session III Topic: Number Systems Faculty: Anita Kanavalli Department of CSE M S Ramaiah.
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.
Chapter1: Number Systems
Number Systems Prepared by Department of Preparatory year.
Positional Notation 642 in base 10 positional notation is:
CPIT 201 Introduction to Computing
Number System sneha.
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.
Data Representation, Number Systems and Base Conversions
Octal to Decimal Hexadecimal DecimalOctal Binary.
MicroProcessors Dr. Tamer Samy Gaafar Dept. of Computer & Systems Engineering Faculty of Engineering Zagazig University.
1. Number Systems. Common Number Systems SystemBaseSymbols Used by humans? Used in computers? Decimal100, 1, … 9YesNo Binary20, 1NoYes Octal80, 1, … 7No.
Binary01.ppt Decimal Decimal: Base 10 means 10 Unique numerical digits ,00010,000 Weight Positions 3,
Data Representation (in computer system). Data Representation How do computers represent data? b The computers are digital Recognize.
Number Systems. Common Number Systems SystemBaseSymbols Used by humans? Used in computers? Decimal100, 1, … 9YesNo Binary20, 1NoYes Octal80, 1, … 7No.
Digital Fundamentals Tenth Edition Floyd Chapter 2 © 2008 Pearson Education.
Lecture 2 Number Systems
MODULE –I NUMBER SYSTEM Digital Design Amit Kumar Assistant Professor SCSE, Galgotias University, Greater Noida.
Computer Number System
1. Number Systems Chapt. 2 Location in course textbook.
ITEC 1011 Introduction to Information Technologies 1. Number Systems Chapt. 2 Location in course textbook.
Prepared By: Md Rezaul Huda Reza University of South Asia Computer Architecture By: Md Rezaul Huda Reza
1. Number Systems. Common Number Systems SystemBaseSymbols Used by humans? Used in computers? Decimal100, 1, … 9YesNo Binary20, 1NoYes Octal80, 1, … 7No.
Number Systems. Topics  The Decimal Number System  The Binary Number System  Converting from Binary to Decimal  Converting from Decimal to Binary.
CHAPTER 3 BINARY NUMBER SYSTEM. Computers are electronic machines which operate using binary logic. These devices use two different values to represent.
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.
CPIT 201 King AbdulAziz University Faculty of Computing & Information Technology Information Technology Department CH 2 Number Systems CPIT 201 Introduction.
1. Number Systems Chapt. 2. Common Number Systems SystemBaseSymbols Used by humans? Used in computers? Decimal100, 1, … 9YesNo Binary20, 1NoYes Octal80,
Introduction to signals The signals are broadly classified into two categories: 1. Analog Signals. 2. Digital signals.
Some basic concepts underlying computer archi­tecture
Octal to Decimal Decimal Octal Binary Hexadecimal.
Discrete Mathematics Numbering System.
1. Number Systems.
NUMBER SYSTEM Prepared by: Engr Zakria.
CHAPTER 1 INTRODUCTION NUMBER SYSTEMS AND CONVERSION
ITE102 – Computer Programming (C++)
Number Systems Lab session 1 Xuan Guo.
Chapter 3 Data Representation
Chapter 1 Number Systems & Conversions
Number Systems and Codes
MMNSS COLLEGE,KOTTIYAM DEPARTMENT OF PHYSICS
Numbering System TODAY AND TOMORROW 11th Edition
Numbering Systems and Arithmetic operations on Hex, binary, and octal
Chapter Four Data Representation in Computers By Bezawit E.
Number Systems created by: S.Shahrukh haider
UNIT – 3 & 4. Data Representation and Internal
1. Number Systems Chapt. 2.
Presentation transcript:

Number Systems

ASCII – American Standard Code for Information Interchange – Standard encoding scheme used to represent characters in binary format on computers – 7-bit encoding, so 128 characters can be represented – 0 to 31 (& 127) are "control characters" (cannot print) Character Representation

Decimal, hex & character representations are easier for humans to understand; however… All the data in the computer is binary An int is typically 32 binary digits – int y = 5; (y = 0x ;) In computer y = A char is typically 8 binary digits – char x = 5; (or char x = 0x05;) In computer, x = Binary Data

Computer systems are constructed of digital electronics. That means that their electronic circuits can exist in only one of two states: on or off. Most computer electronics use voltage levels to indicate their present state. For example, a transistor with five volts would be considered "on", while a transistor with no voltage would be considered "off.” These patterns of "on" and "off" stored inside the computer are used to encode numbers using the binary number system. Because of their digital nature, a computer's electronics can easily manipulate numbers stored in binary by treating 1 as "on" and 0 as "off.” How Computers Store Numbers

A number system defines how a number can be represented using distinct symbols. A number can be represented differently in different systems. For example, the two numbers (2A) 16 and (52) 8 both refer to the same quantity, (42) 10, but their representations are different. Number System

S = {0, 1, 2, 3, 4, 5, 6, 7} Common Number Systems SystemBaseSymbols Used by humans? Used in computers? Decimal100, 1, … 9YesNo Binary20, 1NoYes Octal80, 1, … 7No Hexa- decimal 160, 1, … 9, A, B, … F No

The word decimal is derived from the Latin root decem (ten). In this system the base b = 10 and we use ten symbols: The symbols in this system are often referred to as decimal digits or just digits. Decimal S = {0, 1, 2, 3, 4, 5, 6, 7, 8, 9}

The word binary is derived from the Latin root bini (or two by two). In this system the base b = 2 and we use only two symbols: The symbols in this system are often referred to as binary digits or bits (binary digit). Binary S = {0, 1}

The word hexadecimal is derived from the Greek root hex (six) and the Latin root decem (ten). In this system the base b = 16 and we use sixteen symbols to represent a number. The set of symbols is: Note that the symbols A, B, C, D, E, F are equivalent to 10, 11, 12, 13, 14, and 15 respectively. The symbols in this system are often referred to as hexadecimal digits. Each hexadecimal digit represents four binary digits (bits), and the primary use of hexadecimal notation is a human-friendly representation of binary-coded values in computing and digital electronics. Hexadecimal S = {0, 1, 2, 3, 4, 5, 6, 7, 8, 9, A, B, C, D, E, F}

The word octal is derived from the Latin root octo (eight). In this system the base b = 8 and we use eight symbols to represent a number. The set of symbols is: Each octal digit represents three binary digits (bits) Octal S = {0, 1, 2, 3, 4, 5, 6, 7}

Types of Number System

Conversion Among Bases DecimalOctal Binary Hexadecimal The possibilities:

Quick Example = = 31 8 = Base

Binary to Decimal DecimalOctal Binary Hexadecimal

Technique Multiply each bit by 2 n, where n is the “power” of the bit The power is the position of the bit, starting from 0 on the right ADD the results Binary to Decimal => 1 x 2 0 = 1 1 x 2 1 = 2 0 x 2 2 = 0 1 x 2 3 = 8 0 x 2 4 = 0 1 x 2 5 = Example Bit 0

Technique Multiply each bit by 2 n, where n is the “power” of the bit The power is the position of the bit, starting from 0 on the right ADD the results FRACTIONS Binary to Decimal => Example Bit 0 0 x (1/16) = 0 1 x (1/8) = 1/8 1 x (1/4) = 1/4 0 x (1/2) = 0 0 x (1) = 0 1 x (2) = Ans: 2.375

Octal to Decimal DecimalOctal Binary Hexadecimal

Technique Multiply each bit by 8 n, where n is the “power” of the bit The power is the position of the bit, starting from 0 on the right Add the results Octal to Decimal Example Bit => 4 x 8 0 = 4 2 x 8 1 = 16 7 x 8 2 =

Hexadecimal to Decimal DecimalOctal Binary Hexadecimal

Technique Multiply each bit by 16 n, where n is the “power” of the bit The power is the position of the bit, starting from 0 on the right Add the results Hexadecimal to Decimal Example ABC 16 => C x 16 0 = 12 x 1 = 12 B x 16 1 = 11 x 16 = 176 A x 16 2 = 10 x 256 =

Decimal to Binary DecimalOctal Binary Hexadecimal

Technique Divide by the base 2, keep track of the remainder Keep dividing until the quotient is 0. Take the remainder from the bottom and move upwards as the answer Decimal to Binary E.g.: Convert to binary Take the remainder from bottom upwards as answer Ans:

Technique For the numbers after the point, multiply it by 2 From the answer, take again the fraction part and multiply it by 2 again Keep on multiplying the fraction by 2 until the fraction part is 0 FRACTIONS Decimal to Binary E.g.: Convert to binary Ans: / 2 = 6 6 / 2 = 3 3 / 2 = 1 1 / 2 = 0 R0 R X 2 = X 2 =

x x x x x x etc FRACTIONS Decimal to Binary

Octal to Binary DecimalOctal Binary Hexadecimal

Technique Convert each octal digit to a 3-bit equivalent binary representation 1 octal digit = 3 binary digits Octal to Binary E.g.: Convert to binary Start from the right ‘0’ bit Ans:

Binary to Octal DecimalOctal Binary Hexadecimal

Technique Divide the binary bits in group of 3’s, starting from the RIGHT Add 0’s to the last group to make it 3 bits Convert each grouped binary to their octal digits Binary to Octal E.g.: Start from the right ‘0’ bit Ans: Divide the binary numbers into groups of 3’s. Add ‘0’ to the last group to make it 3 bits

Hexadecimal to Binary DecimalOctal Binary Hexadecimal

Technique Convert each hexadecimal digit to a 4-bit equivalent binary representation 1 hexadecimal digit = 4 binary digits Hexadecimal to Binary E.g.: Convert 3A8 16 to binary 3 A (10) Start from the right ‘0’ bit Ans:

Binary to Hexadecimal DecimalOctal Binary Hexadecimal

Technique Divide the binary bits in group of 4’s, starting from the RIGHT Add 0’s to the last group to make it 4 bits Convert each grouped binary to their hexadecimal digits Binary to Hexadecimal E.g.: (B) 11 (B) Start from the right ‘0’ bit Ans: 2BB Divide the binary numbers into groups of 4’s. Add ‘0’ to the last group to make it 4 bits

Decimal to Octal DecimalOctal Binary Hexadecimal

Technique Divide by the base 8, keep track of the remainder Keep dividing until the quotient is 0. Take the remainder from the bottom and move upwards as the answer Decimal to Octal E.g.: Convert to octal Ans: Take the remainder from bottom upwards as answer

Decimal to Hexadecimal DecimalOctal Binary Hexadecimal

Technique Divide by the base 16, keep track of the remainder Keep dividing until the quotient is 0. Take the remainder from the bottom and move upwards as the answer Decimal to Hexadecimal E.g.: Convert to binary Ans: 81F 16 Take the remainder from bottom upwards as answer

Octal to Hexadecimal DecimalOctal Binary Hexadecimal

Technique First step: Convert the octal digits to their 3-bits binary Second step: Combined the binary obtained Third step: Divide the binary into groups of 4 (hexadecimal) starting from the RIGHT Fourth step: Find the hexadecimal digit from the grouped binary Octal to Hexadecimal E.g.: Start from the right ‘0’ bit Ans: 23E 16 Divide the binary numbers into groups of 4’s. Add ‘0’ to the last group to make it 4 bits / 0011 / (E)32

Hexadecimal to Octal DecimalOctal Binary Hexadecimal

Technique First step: Convert the hexadecimal digits to their 4-bits binary Second step: Combined the binary obtained Third step: Divide the binary into groups of 3 (octal ) starting from the RIGHT Fourth step: Find the octal digit from the grouped binary Hexadecimal to Octal E.g.: C45 16 C (12) 4 5 Start from the right ‘0’ bit Ans: Divide the binary numbers into groups of 4’s. Add ‘0’ to the last group to make it 4 bits / 0 01 / 00 0 /

Binary Addition Binary addition between 2 1-bit values: ABA + B Z= A+B “TWO”

Two n-bit values Add individual bits Propagate carries E.g.: Binary Addition

ABA - BZ = A-B , borrow Binary Subtraction Binary subtraction between 2 1-bit values:

Binary Subtraction E.g.: 1001 – = ? is larger than So swap so that the larger number is in front and the smaller number is after. Subtract the numbers and negate the answer by putting the ‘-’ sign in front. Borrow ‘1’ from the next binary digit. Hence the number will become 10 which is equals to ‘2’. In situations like A – B, whereby the binary number ‘B’ is larger than A, swap the number so that B is in front: B – A. Then negate the answer: B – A = -Y