Number Systems. Introduction / Number Systems



Similar documents
Oct: 50 8 = 6 (r = 2) 6 8 = 0 (r = 6) Writing the remainders in reverse order we get: (50) 10 = (62) 8

Goals. Unary Numbers. Decimal Numbers. 3,148 is s 100 s 10 s 1 s. Number Bases 1/12/2009. COMP370 Intro to Computer Architecture 1

Lecture 11: Number Systems

LSN 2 Number Systems. ECT 224 Digital Computer Fundamentals. Department of Engineering Technology

Binary, Hexadecimal, Octal, and BCD Numbers

Useful Number Systems

EE 261 Introduction to Logic Circuits. Module #2 Number Systems

2011, The McGraw-Hill Companies, Inc. Chapter 3

Chapter 2. Binary Values and Number Systems

CPEN Digital Logic Design Binary Systems

Digital System Design Prof. D Roychoudhry Department of Computer Science and Engineering Indian Institute of Technology, Kharagpur

Number Conversions Dr. Sarita Agarwal (Acharya Narendra Dev College,University of Delhi)

The string of digits in the binary number system represents the quantity

3. Convert a number from one number system to another

CSI 333 Lecture 1 Number Systems

Binary Representation. Number Systems. Base 10, Base 2, Base 16. Positional Notation. Conversion of Any Base to Decimal.

NUMBER SYSTEMS. 1.1 Introduction

Decimal to Binary Conversion

Section 1.4 Place Value Systems of Numeration in Other Bases

2 Number Systems. Source: Foundations of Computer Science Cengage Learning. Objectives After studying this chapter, the student should be able to:

Binary Representation

Number and codes in digital systems

Binary Numbers. Binary Octal Hexadecimal

CDA 3200 Digital Systems. Instructor: Dr. Janusz Zalewski Developed by: Dr. Dahai Guo Spring 2012

Positional Numbering System

Systems I: Computer Organization and Architecture

Chapter 4: Computer Codes

Lecture 2. Binary and Hexadecimal Numbers

Base Conversion written by Cathy Saxton

Unsigned Conversions from Decimal or to Decimal and other Number Systems

=

Number Representation

Levent EREN A-306 Office Phone: INTRODUCTION TO DIGITAL LOGIC

A Step towards an Easy Interconversion of Various Number Systems

Chapter 1: Digital Systems and Binary Numbers

Numbering Systems. InThisAppendix...

plc numbers Encoded values; BCD and ASCII Error detection; parity, gray code and checksums

Chapter 7 Lab - Decimal, Binary, Octal, Hexadecimal Numbering Systems

Machine Architecture and Number Systems. Major Computer Components. Schematic Diagram of a Computer. The CPU. The Bus. Main Memory.

Counting in base 10, 2 and 16

The Hexadecimal Number System and Memory Addressing

ELEG3924 Microprocessor Ch.7 Programming In C

Digital codes. Resources and methods for learning about these subjects (list a few here, in preparation for your research):

NUMBER SYSTEMS. William Stallings

Digital Design. Assoc. Prof. Dr. Berna Örs Yalçın

PROGRAMMABLE LOGIC CONTROLLERS Unit code: A/601/1625 QCF level: 4 Credit value: 15 TUTORIAL OUTCOME 2 Part 1

Cyber Security Workshop Encryption Reference Manual

Everything you wanted to know about using Hexadecimal and Octal Numbers in Visual Basic 6

Today s topics. Digital Computers. More on binary. Binary Digits (Bits)

Computer Science 281 Binary and Hexadecimal Review

COMPSCI 210. Binary Fractions. Agenda & Reading

Numeral Systems. The number twenty-five can be represented in many ways: Decimal system (base 10): 25 Roman numerals:

CS101 Lecture 11: Number Systems and Binary Numbers. Aaron Stevens 14 February 2011

THE BINARY NUMBER SYSTEM

Number Systems and Radix Conversion

ASCII and BCD Arithmetic. Chapter 11 S. Dandamudi

Memory is implemented as an array of electronic switches

Divide: Paper & Pencil. Computer Architecture ALU Design : Division and Floating Point. Divide algorithm. DIVIDE HARDWARE Version 1

Technical Support Bulletin Nr.18 Modbus Tips

Data Representation. What is a number? Decimal Representation. Interpreting bits to give them meaning. Part 1: Numbers. six seis

CS321. Introduction to Numerical Methods

2010/9/19. Binary number system. Binary numbers. Outline. Binary to decimal

Digital Logic Design. Introduction

Streaming Lossless Data Compression Algorithm (SLDC)

BCD (ASCII) Arithmetic. Where and Why is BCD used? Packed BCD, ASCII, Unpacked BCD. BCD Adjustment Instructions AAA. Example

ARINC 429 Protocol Tutorial

BINARY CODED DECIMAL: B.C.D.

Solution for Homework 2

Chapter Binary, Octal, Decimal, and Hexadecimal Calculations

To convert an arbitrary power of 2 into its English equivalent, remember the rules of exponential arithmetic:

The New IoT Standard: Any App for Any Device Using Any Data Format. Mike Weiner Product Manager, Omega DevCloud KORE Telematics

PREPARATION FOR MATH TESTING at CityLab Academy

Binary Number System. 16. Binary Numbers. Base 10 digits: Base 2 digits: 0 1

The Answer to the 14 Most Frequently Asked Modbus Questions

Verilog - Representation of Number Literals

Modbus Protocol. PDF format version of the MODBUS Protocol. The original was found at:

Modbus RTU Communications RX/WX and MRX/MWX

ARINC429. Specification Tutorial

Sheet 7 (Chapter 10)

Karnaugh Maps & Combinational Logic Design. ECE 152A Winter 2012

Computers. Hardware. The Central Processing Unit (CPU) CMPT 125: Lecture 1: Understanding the Computer

Solution Guide Chapter 14 Mixing Fractions, Decimals, and Percents Together

eztcp Technical Document Modbus/TCP of eztcp Caution: Specifications of this document may be changed without prior notice for improvement.

Unpacked BCD Arithmetic. BCD (ASCII) Arithmetic. Where and Why is BCD used? From the SQL Server Manual. Packed BCD, ASCII, Unpacked BCD

Lab 17: Building a 4-Digit 7-Segment LED Decoder

Lesson 9: Radicals and Conjugates

1.Eastron SDM220Modbus Smart Meter Modbus Protocol Implementation V1.0

Digital to Analog and Analog to Digital Conversion

COMP 250 Fall 2012 lecture 2 binary representations Sept. 11, 2012

Z80 Instruction Set. Z80 Assembly Language

Byte Ordering of Multibyte Data Items

Binary Division. Decimal Division. Hardware for Binary Division. Simple 16-bit Divider Circuit

Computer Science PLUS I Volume 1 : Concepts Government of Tamilnadu

Chapter 1: Order of Operations, Fractions & Percents

Numeration systems. Resources and methods for learning about these subjects (list a few here, in preparation for your research):

IBM Emulation Mode Printer Commands

Section 4.1 Rules of Exponents

Mifare DESFire Specification

Graphing Rational Functions

Transcription:

Number Systems Introduction / Number Systems

Data Representation Data representation can be Digital or Analog In Analog representation values are represented over a continuous range In Digital representation values are represented over a discrete range Digital representation can be We need to know how to use Hexadecimal and convert from one to another!

Using Representation Digital systems are binary-based All symbols are represented in binary format Each symbol is represented using Bits A bit can be one or zero (on or off state) Comparing and systems: In a digit is [0-9] base-10 In a digit is [0-1] base-2 In two digits can represent [0-99] 10 2-1 In two digits can represent [0-3] 2 2-1

Counting Point

Counting in Different Numbering Systems 0,1,2,3,4,5,6,7,8,9,10,11,12,19,20,21,,29,30,,39. 0,1,10,11,100,101,110,111,1000,. 0,1,2,3,4,5,6,7,10,11,12,17,20,21,22,23,27,30, Hexadecimal Demonstrating different number base or radix 0,1,2,3,4,5,6,7,8,9,A,B,C,D,E,F,10,,1F,20,,2F,30,.. Remember: aa.bb aa is whole number portion bb is fractional portion. is the radix point

Learning Number Conversion Hexasdecimal BCD/ ASCII

-to- Conversions 11011 Hexasdecimal 4 3 2 1 0 1 2 1 2 0 2 1 2 1 2 16 8 2 1 27 10 ( n Convert 0 1 2 3 N 1 nn 2... n3n2n1n 0) b n 0 b n1 b n2 b n3 b... n BCD N 1 b N 1 In the above example: is base-2 (b=2) n 0 =1 n 1 =1 n 2 =0 n 3 =1 n 4 =1 Q: What is 11011.11 In? Ans: =27+(1x2-1 + 1x2-2 ) =27+0.5+0.25 =27.75

-to- Conversions Quotient + Remainder 65 / 2 32 Re mainder _ of _1 32 / 2 16 Re mainder _ of 16 / 2 8 Re mainder _ of 8/ 2 4 Re mainder _ of 4 / 2 2 Re mainder _ of 2 / 2 1 Re mainder _ of 1/ 2 0 Re mainder _ of Last one should be 0 _ 0 _ 0 _ 0 _ 0 _1 LSB = Least Significant Bit MSB= Most Significant Bit _ 0 65 1000001 MSB LSB Hexasdecimal 1- Save the remainder 2- Continue until Quotient = 0 What if you are using a calculator? 65/2 = 32.5 0.5 x 2 (base-2) = 1 BCD

-to- Conversions 0.125 Radix point +The whole portion + The fractional portion 0.125* 2 0 0.25* 2 0 0.5*2 1 fractional _ portion _ of _ 0.25 fractional _ portion _ of _ 0.5 fractional _ portion _ of _ 0 0.001 LSB Last one should be 1

/ Conversions is base-8 (b=8) 372 Hexasdecimal 2 1 0 38 78 28 364 78 21 250 10 ( n Convert 0 1 2 3 N 1 nn 2... n3n2n1n 0) b n 0 b n1 b n2 b n3 b... n BCD N 1 b N 1 What about 372.2 8? Ans: =250+(2x8-1 )=250.25 -to-: 266 266 / 8 33 Re mainder _ of _ 2 33/ 8 4 Re mainder _ of _1 4 / 8 0 Re mainder _ of _ 4 412 MSB LSB Hexasdecimal BCD

Hex-to- Conversions is base-16 (b=16) 2AF Hexasdecimal 2 1 0 216 1016 1516 512 160 16 687 10 ( n Convert 0 1 2 3 N 1 nn 2... n3n2n1n 0) b n 0 b n1 b n2 b n3 b... n BCD N 1 b N 1 Remember A=10, F=15 In the above example: is base-16 (b=16) n 0 =F which is 15 n 1 =A which is 10 n 2 =2

-to-hex Conversions 423 Hex Hexasdecimal 423/16 26 Re mainder _ of _ 7 26 /16 1 Re mainder _ of _10 1/16 0 Re mainder _ of _1 214 /16 13 Re mainder _ of _ 6 13/16 0 Re mainder _ of _13 214 Hex 1A7 MSB LSB D6 Remember 10 in Hex is A BCD Last one should be 0 Remember 13 in Hex is D

Converting from Hex-to- 124 Hex?? Oct Hexasdecimal Always convert to first and then from binary to Oct. BCD Ans: =124 Hex = 0001 0010 0100 = 000 100 100 100 =0 4 4 4 =444 Oct

Counting 0,1,2,3,4,5,6,7,8,9,10,11,12,19,20,21,,29,30,,39. 0,1,10,11,100,101,110,111,1000,. 0,1,2,3,4,5,6,7,10,11,12,17,20,21,22,23,27,30, Hexadecimal 0,1,2,3,4,5,6,7,8,9,A,B,C,D,E,F,10,,1F,20,,2F,30,..

Converting to BCD and ASCII We use Hex and numbers to simplify number representation Any symbol can be represented by a code Example: American Standard Code for Information Interchange (ASCII) Each symbol is represented by a seven-bit code (How many symbols can be represented? 127) Example: A=100 0001 = 41 in Hex, 1=011 0000 = 31 in Hex, $=010 0100 = 24 in Hex (What is DAD in ASCII?) Look at the ASCII code listing Don t memorize!

Converting to BCD and ASCII We use Hex and numbers to simplify number representation Any symbol can be represented by a code Example: -Coded-decimal (BCD) Each digit has its own binary code Example: 6 10 =0110, 16 10 =0001 0110 (In binary 16 is?) BCD can be packed or unpacked 12 Packed=0001 0010 ; unpacked=0000 0001 0000 0010

Terminologies BYTE 8 bits is equivalent to one byte NIBBLE 4 bits is equivalent to one nibble WORD 16 bits is equivalent to one word 8-BIT ME! 1. 128 bits is equivalent to how many bytes? 128/8 = 16 2. What is the maximum number that can be represented by 1 bytes? 2 8-1 = 255

Switch State In each case we have 16 switches. 1- What //Hexadecimal number does each switch represent? 2- What is the maximum binary number we can represent using these switches? 0000000100100011=291= 123 0100010101100111=17767=4567 1000100110101011=35243=89AB 1100110111101111=52719=CDEF Maximum number: 2 16-1=65536-1=65535=64K in Computer terms!