Number Systems.

Slides:



Advertisements
Similar presentations
Data Representation. Units & Prefixes Review kilo, mega, and giga are different in binary! bit (b) – binary digit Byte (B) – 8 binary digits KiloByte.
Advertisements

© 2004, Robert K. Moniot Binary and Hex How to count like a computer.
ECE 331 – Digital System Design
Data Representation COE 202 Digital Logic Design Dr. Aiman El-Maleh
A-Level Computing#BristolMet Session Objectives#8 express numbers in binary, octal and hexadecimal explain the use of code to represent a character set.
Company LOGO Edit your slogan here DKT 122/3 DIGITAL SYSTEM 1 WEEK #3 NUMBER SYSTEMS, OPERATION & CODES (PART 2)
Lecturer: Omid Jafarinezhad Sharif University of Technology Department of Computer Engineering 1 Fundamental of Programming (C) Lecture 2 Number Systems.
Number Representation (1) Fall 2005 Lecture 12: Number Representation Integers and Computer Arithmetic.
Data Representation in Computers
Computer Arithmetic: Binary, Octal and Hexadecimal Presented by Frank H. Osborne, Ph. D. © 2005 ID 2950 Technology and the Young Child.
BASICS OF COMPUTER APPLICATIONS ASB 102. UNIT 1 Introducing computer system  Number system  What is number system?  Types of number system  Their.
Lesson 2 0x Coding ASCII Code.
Hexadecimal and ASCII Lesson Objective: Understand the purpose of ASCII and how to use it. Lesson Outcome: Convert between Hexadecimal and ASCII Convert.
Connecting with Computer Science 2 Objectives Learn why numbering systems are important to understand Refresh your knowledge of powers of numbers Learn.
Agenda Data Representation Purpose Numbering Systems Binary, Octal, Hexadecimal (Hex) Numbering System Conversions Binary to Octal, Octal to Binary Binary.
Digital Colour Theory. What is colour theory? It is the theory behind colour mixing and colour combination.
EKT 121 / 4 ELEKTRONIK DIGIT 1 CHAPTER 1 : INTRODUCTION.
DECIMAL BASE Based on power of 10 In the number 2,468 – from right to left -- the 8 represents the ones, the 6 represents the tens, the 4 represents the.
Computer Math CPS120: Data Representation. Representing Data The computer knows the type of data stored in a particular location from the context in which.
EX_01.1/46 Numeric Systems. EX_01.2/46 Overview Numeric systems – general, Binary numbers, Octal numbers, Hexadecimal system, Data units, ASCII code,
Representing Data. Representing data u The basic unit of memory is the bit  A transistor that can hold either high or low voltage  Conceptually, a tiny.
NUMBER SYSTEM.
CONVERSION OF NUMBER SYSTEMS FAHEEM ANWAR MANAGER NETWORKS ACADEMY PTCL ACADEMY.
ENGINEERS FUTURE To optimize things When we type some letters or words, the computer translates them in numbers as computers can understand only numbers.
Number Systems CIT Network Math
Number systems, Operations, and Codes
The Hexadecimal Number System and Memory Addressing ISAT 121.
Number System. Number Systems Important Number systems – Decimal – Binary – Hexadecimal.
Number Bases In today’s lesson we will look at: what we mean by a number base how ordinary numbers work a number system called binary why binary is useful.
CPS120: Introduction to Computer Science Computer Math: Converting to Decimal.
1 Data Representation Characters, Integers and Real Numbers Binary Number System Octal Number System Hexadecimal Number System Powered by DeSiaMore.
Number Systems and Digital Codes
Data Representation, Number Systems and Base Conversions
Programming Logic Controllers Number Systems and Codes - Chapter 3.
Irvine, Kip R. Assembly Language for Intel-Based Computers 6/e, Signed Integers The highest bit indicates the sign. 1 = negative, 0 = positive.
Number Systems Denary Base 10 Binary Base 2 Hexadecimal Base 16
Computer Science and Software Engineering© 2014 Project Lead The Way, Inc. Bits and Bytes.
Digital Fundamentals Tenth Edition Floyd Chapter 2 © 2008 Pearson Education.
Data Representation. How is data stored on a computer? Registers, main memory, etc. consists of grids of transistors Transistors are in one of two states,
Number Systems. Topics  The Decimal Number System  The Binary Number System  Converting from Binary to Decimal  Converting from Decimal to Binary.
Computer Studies Today Chapter 19 1 Chapter 19. Computer Studies Today Chapter 19 2 »Information stored in a computer is in two states: –ON –OFF.
Base 16 (hexadecimal) Uses the decimal digits and the first letters of the alphabet to encode 4 binary bits (16=2 4 ) abcdef or ABCDEF.
1 Chapter 1: Introduction Appendix A: Binary and Hexadecimal Tutorial Assembly Language for Intel-Based Computers, 3rd edition Kip R. Irvine.
Searching Binary and Hexadecimal numeral systems
Computer Science 210 Computer Organization
Computer Applications for Biological
Converting Fractions into Decimals into Percents & Vice Versa
Binary 1 Basic conversions.
By: Jonathan O. Cabriana
CHAPTER 1 : INTRODUCTION
EPSII 59:006 Spring 2004.
Writer:-Rashedul Hasan. Editor:- Jasim Uddin
CSE 102 Introduction to Computer Engineering
Number System conversions
SYEN 3330 Digital Systems Chapter 1 SYEN 3330 Digital Systems.
Hexadecimal Binary Made Easier.
Numbering System TODAY AND TOMORROW 11th Edition
Computer Science 210 Computer Organization
Number Systems Lecture 2.
Chapter 2: Number Systems
Digital Logic Design (CSNB163)
Number Theory.
Chapter 2 Number Systems.
Numeral systems (radix)
Chapter 2 Number Systems.
Chapter 2 Number Systems.
Chapter 3 - Binary Numbering System
Lecture 36 – Unit 6 – Under the Hood Binary Encoding – Part 2
Chapter 2 Number Systems.
Presentation transcript:

Number Systems

Number Systems We are using the decimal number system to represent numerical values Binary – Octal – Hexadecimal number systems are used in digital computer field Digital computers could not use decimal numbers in calculations

Decimal Number System The system has 10 symbols (0,1,2,3,4,5,6,7,8,9) The base of the system = 10 Notice the difference between the values of the digit “1” in this number 191.512 The value of any number is calculated by the base-position rule Ex: What is the value of (1234.56)? Thousands Hundreds Tens Ones Tenths Hundredths 1 2 3 4 . 5 6 1000 100 10 0.1 0.01 Position Value 200 30 0.5 0.06 Number Value

Binary Number System The system has only 2 symbols (0,1) The base of the system is “2” Examples of binary numbers: (101,111 , 100.001) Binary number system is used in representing all characters and symbols by using Standard Code as: ASCII (7 bits = 128 characters) ANSI (8 bits = 256 characters) UNICODE (16 bits = 65536 characters)

Example on Binary number system What is the value of this binary number (10111.01)2 in decimal? 1 0 1 1 1 . 0 1 X 24 23 22 21 20 . 2-1 2-2 16+ 0+ 4+ 2+ 1+ 0.0+ 0.25 = 23.25

Octal Number System The system has 8 symbols (0,1,2,3,4,5,6,7) The base of the system = 8 Examples of octal numbers: (171, 11.4 , 512) To find the value of octal number in our decimal system you should take care of the difference between the 2 bases. The number (17)8 is not (17) in decimal

Setting UNIX Access Rights UNIX access rights are assigned to every file and directory on the server. Rights have the form: drwxrwxrwx d means if it is a directory or not r means read w means write x means execute There are three sets of rwx rights. These are for you, for those in your group and for everyone else. Each letter is one bit.

Example on Octal number system What is the decimal value for this octal number (137.4)8 1 3 7 . 4 X 82 81 80 . 8-1 64+ 24+ 7+ 0.5 = 95.5

Properties of Hexadecimal A hexadecimal number is exactly one-half of a byte. Since a byte can be from 0-255 in decimal, it also can be from #00 to #FF in hexadecimal. Use the pound sign (#) as a prefix for hexadecimal numbers. Binary and hexadecimal numbers carry to the other half of the same byte at the same time.

Uses of Hexadecimal On the Internet, documents are written in HTML, the hypertext markup language. All colors on computers are a combination of three colors; red, blue and green; known as RGB. In HTML, you set the values of RGB using hexadecimal numbers. The form for a color is: #RRGGBB

Some Hexadecimal HTML Color Codes

Hexadecimal Number System The system has 16 symbols: (0,1,2,3,…,9,A,B,C,D,E,F) The base of the system = 16 Example of hexadecimal numbers: (1D9, 11B4 , 54F4.1A)

Example on Hexadecimal number system What is the decimal value for this hexadecimal number (AB.4)16 AB.4 = 10*(16)1 + 11*(16)0 + 4*(16)-1 = 10*16 + 11*1 + 4/16 = 160 + 11 + 0.25 = (171.25)10

Conversion between number systems Converting from any number to decimal Converting from decimal to any number system Converting from binary to octal and hexadecimal Converting from octal to hexadecimal system Converting from any number system to another

Conversion from any number system to decimal Using Base and Position rule What is the decimal value of this number (A15.8)16 ? (A15.8)16 = A*(16)2 + 1*(16)1+5*(16)0 +8*(16)-1 = 10*256 + 1*16 +5*1 + 8/16 = 2560 + 16 + 5 + 0.5 = (2581.5)10

Conversion from decimal to other systems To get the digits of decimal number we can use the successive division by 10 (base) till there will be no reminder (Reminder = 0) Ex:

Conversion from decimal to other system (integer part) We can use the successive division on the new base (2 in case of converting to binary system) till having no reminder The reminders (from bottom to up) are forming the number in the new number system Example: What is the value of (5)10 in binary system? The result is: (101)2 Reminders

Conversion from decimal to other system (fraction part) We can use the successive multiplication by the new base (2 in case of converting to binary system) till having no fraction The integer numbers (from top to bottom) are forming the fraction number in the new number system What is the value of (0.125)10 in binary? fraction integer 0 0.25 2*0.125 0 0.5 2*0.25 1 0.0 2*0.5 The result is: (0.001)2

Conversion between Octal and binary Octal number system uses 8(23) symbols where binary number system uses 2 (21) symbols Each octal digit will be converted to 3 consecutive digits to convert it to binary system Each 3 consecutive binary digits will be converted to 1 octal digit to convert it to octal system Ex: What is the value of (705.3)8 inbinary? (705.3)8 = 111 000 101 . 011 = (111000101.011)2 Ex: What is the value of (1100110.1001)2 in octal? (1100110.1001)2 = (001 100 110 . 100 100)2 = (1 4 6 . 4 4)8 = (146.44)8

Conversion between Hexadecimal and binary Hexadecimal number system uses 16 (24) symbols where binary number system uses 2 (21) symbols Each hexadecimal digit will be converted to 4 consecutive digits to convert it to binary system Each 4 consecutive binary digits will be converted to 1 hexadecimal digit to convert it to hexadecimal system Ex: What is the value of (AFC3.9E)16 in binary? (AFC3.9E)16 = 1010 1111 1100 0011 . 1001 1110 = (1010 111111000011.1001111)2 Ex: What is the value of (1101110.11011)2 in hexadecimal? (1101110.11011)2 = (0110 1110 . 1101 1000)2 = (6 E . D 8)16 = (6E.D8)16

Conversion between Hexadecimal and Octal We can convert the octal (hexadecimal) to binary and then convert the binary to the hexadecimal (octal) What is the value of this number (AFC3.9E)16 in octal? (AFC3.9E)16 = (1010 1111 1100 0011 . 1001 1110)2 = (001 010 111 111 000 011 . 100 111 100)2 = (1 2 7 7 0 3 . 4 7 4)8 = (127703.474)8

Conversion from any system to another We can use the binary system is an intermediate system or you can use the decimal as an intermediate number system 10 project 10 Ass 10 Lab First term 15 Second term 15 Final 40