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

Size: px
Start display at page:

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

## Transcription

1 Numeral Systems Which number is larger? 25 8 We need to distinguish between numbers and the symbols that represent them, called numerals. The number 25 is larger than 8, but the numeral 8 above is larger than the numeral 25. The number twenty-five can be represented in many ways: Decimal system (base 10): 25 Roman numerals: XXV Binary system (base 2): Hexadecimal (base 16): 19 On a computer, the binary switch is easy to implement, so numbers are stored in a computer as binary (on and off). In fact, everything stored in a computer is encoded using the binary number system. numbers, characters, strings, booleans, objects, instructions We need to understand the binary system to understand computers. Copyright 2004 by Ken Slonneger Numeral Systems 1

2 Positional number representation Choose a base (or radix) b, and a set of b distinct symbols. The radix b representation of a nonegative integer m is a string of digits chosen from the set { 0, 1, 2, 3,, b-1 } so that if m = (d k d k-1 d 3 d 2 d 1 d 0 ) b, then m = d k b k + d k-1 b k d 3 b 3 + d 2 b 2 + d 1 b 1 + d 0 b 0 We can represent any nonnegative number in base b by forming such a polynomial where for all d k, 0 d k < b. If b>10, new symbols must be used for digits above 9. Examples Decimal (b=10): Set of digits = { 0, 1, 2, 3, 4, 5, 6, 7, 8, 9 } 493 = = Binary (b=2): Set of digits = { 0, 1 } = = = Octal (b=8): Set of digits = { 0, 1, 2, 3, 4, 5, 6, 7 } = = = Numeral Systems Copyright 2004 by Ken Slonneger

3 Hexadecimal (b=16): Set of digits = { 0, 1, 2, 3, 4, 5, 6, 7, 8, 9, A, B, C, D, E, F } B3F 16 = = = Note that the arithmetic is done in the decimal number system. Number Conversions 1. Converting a radix b numeral to decimal Evaluate the corresponding polynomial. See examples above or use Horner s Method. Horner s Method for Evaluating Polynomials: Start with zero and then alternate adding a digit with multiplying by the base. Binary Example = = ((((((0+1) 2+0) 2+1) 2+1) 2+0) 2+1) 2+1 Multiply by 2 moving down; add a bit moving right = = = = = = = Copyright 2004 by Ken Slonneger Numeral Systems 3

4 Octal Example = = = = = Hexadecimal Example 37D = 3 x = 55 x = 893 x = Converting a decimal numeral to radix b Suppose a decimal numeral m has the following representation in radix b: m = d k b k + d k-1 b k d 3 b 3 + d 2 b 2 + d 1 b + d 0 Divide m by b using decimal arithmetic. quotient = d k b k-1 + d k-1 b k d 3 b 2 + d 2 b + d 1 remainder = d 0 Continue dividing quotients by b, saving the remainders, until the quotient is zero. 4 Numeral Systems Copyright 2004 by Ken Slonneger

5 Pseudo-code Version of Algorithm num = decimal numeral to be converted; k = 0; do { d k = num % b; write symbol for dk; num = num / b; k++; } while (num > 0); // k denotes positions of // symbols from right to left. Resulting numeral, base b d 9 d 8 d 7 d 6 d 5 d 4 d 3 d 2 d 1 d 0 for as many digits as are produced until num becomes zero. Examples Decimal to Octal: Result = Copyright 2004 by Ken Slonneger Numeral Systems 5

6 Decimal to Hexadecimal: Result = 1B6 16 Decimal to Binary: Some Useful Values Quotients Remainders Result = = = = = = = = = = 256 = = 65,536 = = 4,096 = = 1,048,576 = Numeral Systems Copyright 2004 by Ken Slonneger

7 3. Converting Binary to Hexadecimal: Group binary digits, 4 bits at a time, proceeding from right to left, and transform the groups into hexadecimal digits. Binary to Hexadecimal = = 34ED 16 = 34ED H 4. Converting Hexadecimal to Binary: Substitute correct 4 bit patterns for hexadecimal digits. Hexadecimal to Binary 7A5F 16 = Octal and Hexadecimal These number systems provide us with a convenient form of shorthand for working with binary quantities. int m = ; m is stored as 32 bits: Easier to represent as 8 hex digits: 018c6bea Learn the four-bit binary patterns for the 16 hex digits. Note: We are only dealing with nonnegative integers at this time. We call them unsigned integers. Copyright 2004 by Ken Slonneger Numeral Systems 7

8 Arithmetic Algorithms for addition and multiplication are essentially the same for any radix system. The difference lies in the tables that define the sum and product of two digits. Binary Addition: Binary Multiplication: Example x Note: = Tables for hexadecimal are trickier. A + A = 14 A A = 64 Practice: Construct an addition table and a multiplication table in hexadecimal. 8 Numeral Systems Copyright 2004 by Ken Slonneger

9 Finite Representation Numbers inside a computer are constrained to a fixed finite number of bits, which affects range of numbers we can represent. With n bits: Number of possibilities = = 2 n Unsigned numbers may range from 0 to 2 n - 1. Example Consider n = High Range: 0 to (0 to 255 decimal) Hexadecimal representations: 00 to FF Low Representing Negative Integers 1. Sign / magnitude Leftmost bit represents a sign, 0 for + and 1 for. The rest of the bits represent the absolute value of number. With k=6 bits, 9 = = Range of values: -(2 k-1-1) to (2 k-1-1). For k=6, the values range from -31 to 31. Only 5 bits available to represent the magnitude. The maximum and minimum numbers, and , have equal magnitude Copyright 2004 by Ken Slonneger Numeral Systems 9

10 Problems We have two forms of zero, and Arithmetic is expensive because we need an adder and a subtractor to do addition. If the signs are the same, add the magnitudes. If the signs are different, subtract the smaller magnitude from the larger and keep the sign from the larger magnitude. 2. Two s complement Nonnegative integers 0 to (2 k-1-1) are represented in binary the same way as with sign-magnitude, 0 followed by a (k-1)- bit absolute value. Negative integers -(2 k-1 ) to -1 are represented by adding 2 k and expressing the result in binary. Example k=6 2 = = = = Note that 2 k = = 62 = = 51 = = 34 = = 32 = Arithmetic: 2 + (-2) = = Numeral Systems Copyright 2004 by Ken Slonneger

11 Ways of Interpreting Bit Patterns (k = 4) BIT SIGN & TWO S PATTERN UNSIGNED MAGNITUDE COMPLEMENT Algorithm for Negating a Number in two's complement a) Complement (flip) each bit. b) Add 1 Complementing a k-bit number is same as subtracting it from 2 k - 1. Copyright 2004 by Ken Slonneger Numeral Systems 11

12 Examples k=6 Note 2 k -1 = = a) Complement bits: b) Add one: = a) Complement bits: b) Add one: = a) Complement bits: b) Add one: (discard left carry) The high order bit still represents sign of the number (0 for nonnegative and 1 for negative). Now we have only one form of zero. The magnitudes of the maximum and minimum values differ: minimum = maximum + 1 Hence, one number cannot have the negation operation performed on it. Which one? int num = ; -num is an erroneous operation now. long big = ; -big is an erroneous operation now. 12 Numeral Systems Copyright 2004 by Ken Slonneger

13 Odometer principle for twos-complement Evaluating Twos Complement The problem is converting negative twos complement to decimal. Procedure 1. Find twos complement negative of number (a positive value). 2. Convert that number to decimal 3. Append a minus sign. Copyright 2004 by Ken Slonneger Numeral Systems 13

14 Examples k = Negate to get Convert to decimal: = 105 Append minus: Negate to get Convert to decimal: 1 Append minus: Negate to get Convert to decimal: 64 Append minus: -64 Exercise: Assuming 6 bit numbers, what values are represented by a) and b) ? Addition of Signed Numbers Sign / magnitude: Follow the same rules you use when working with the decimal arithmetic learned in grade school. Add magnitudes when signs are the same. Subtract magnitudes when signs are different. Example Since the signs are the same, we add the magnitudes of the two numbers Note that we do not add the signs Now append the sign to get Numeral Systems Copyright 2004 by Ken Slonneger

15 Example Since the signs are different, we subtract the magnitudes of the two numbers Note that we do not subtract the signs Larger magnitude Smaller magnitude Now append sign of the larger to get Two s complement Arithmetic Add right to left, bit by bit, including the sign bits. Ignore any carry out of the sign position. Binary Decimal Explanation (optional) * = = * Carries are discarded Copyright 2004 by Ken Slonneger Numeral Systems 15

16 Overflow Add two nonnegative numbers and get a negative answer. Add two negative numbers and get a nonnegative answer. Radix Conversions in Java Converting decimal (int) to other bases int m = ; Integer.toBinaryString(m) returns " " Integer.toOctalString(m) returns "361100" Integer.toHexString(m) returns "1e240" Integer.toString(m) returns "123456" Converting other bases to decimal Integer.parseInt(" ", 2) Integer.parseInt("361100", 8) Integer.parseInt("1e240", 16) Integer.parseInt("123456") each returns the int Octal and Hex Literals and Unicode int k = 0123; // leading 0 means octal digits int m = 0xabc; // leading 0x means hex digits char c = '\u0041'; // char 'A' = 41 hex 16 Numeral Systems Copyright 2004 by Ken Slonneger

17 Logical Instructions Java performs logical operations on integers of type int and long. int m1, m2, n. m1 = some value; m2 = some other value; OR n = m1 m2; m1 and m2 are bit-wise OR-ed to produce the result. 1 1 = = 1 1 means true 0 1 = 1 0 means false 0 0 = 0 AND n = m1 & m2; m1 and m2 are bit-wise AND-ed to produce the result. 1 & 1 = 1 1 & 0 = 0 0 & 1 = 0 0 & 0 = 0 Exclusive OR n = m1 ^ m2; m1 and m2 are bit-wise Exclusive OR-ed to produce the result. 1 ^ 1 = 0 Equivalent to 1 ^ 0 = 1 0 ^ 1 = 1 0 ^ 0 = 0 Copyright 2004 by Ken Slonneger Numeral Systems 17

18 NOT n = ~m1; All the bits in m1 are complemented to produce the result. ~1 = 0 ~0 = 1 Examples Suppose we have declarations int m = 0x6ca64; int n = 0xB93DE; int ans; OR ans = m n; m = n = m n = AND ans = m & n; m = n = m & n = Numeral Systems Copyright 2004 by Ken Slonneger

19 Exclusive OR (acts like not-equal) ans = m ^ n; m = n = m ^ n = NOT ans = ~m; m = ~m = Bit Masks Terminology Clear a bit: Make it 0 Set a bit: Make it 1 Problem: Clear all the bits in n. n = 0; Problem: Clear bits in the first and third bytes in n. n = n & 0x00FF00FF Problem: Set all the bits in n. n = 0xFFFFFFFF; or n = -1; // lead zeros redundant Problem: Set the bits in the first and fourth bytes in n. n = n 0xFF0000FF; Copyright 2004 by Ken Slonneger Numeral Systems 19

20 Problem: Flip all the bits in n. n = ~n; Problem: Flip the bits in the fourth byte in n. Shift Operations n = n ^ 0x000000FF; Move the bits in a word to the left or right. Two Kinds Logical Shifts: // lead zeros redundant Word filled with zeros as bits are moved. Arithmetic Shifts: Left shift is same as logical shift. Right shift replicates the sign bit Shift operations take two operands. int word; // Word to be shifted int numb; // Number of bits to shift Only the last six bits of the shift number are considered, giving shift distance 0 numb 63. Logical shift left word = word << numb; Logical shift right word = word >>> numb; Arithmetic shift left word = word << numb; 20 Numeral Systems Copyright 2004 by Ken Slonneger

21 Arithmetic shift right word = word >> numb; Examples Suppose we have declarations int p = 500; int q = -12; int ans; ans = p << 2; p = p<<2 = ans has the value ans = p >>> 2; // same as p >> 2 in this case (p 0) p = p>>> 2 = ans has the value 125. ans = q << 3; q = q<<3 = ans has the value -96. ans = q >> 3; q = q>>3 = ans has the value -2. Copyright 2004 by Ken Slonneger Numeral Systems 21

22 ans = q >>> 3; q = q>>>3 = ans has the value Sign Extension Observe what happens when integers are enlarged or truncated. Binary Storage Hexadecimal byte b1 = 100; byte b2 = -10; F6 int n1 = b1; int n2 = b2; FFFFFFF6 int n3 = -200; FFFFFF38 byte b3 = (byte)n3; 38 (= ) int n4 = 150; byte b4 = (byte)n3; 96 (= ) 22 Numeral Systems Copyright 2004 by Ken Slonneger

23 Character Data Computers do not store character data directly. IO devices provide for a mapping between the character symbols and internal form of the characters. For portability between machines, standard encodings of characters are used. Ascii 8 bits Up to 256 characters Unicode 16 bits Up to 65,536 characters Unicode is an extension of ascii: Ascii 'A' is Unicode 'A' is Typing the letter A on the keyboard sends the binary string to the computer, which stores it as in Java. Copyright 2004 by Ken Slonneger Numeral Systems 23

24 ASCII Character Set In Hexadecimal 00 nul 01 soh 02 stx 03 etx 04 eot 05 enq 06 ack 07 bel 08 bs 09 ht 0a nl 0b vt 0c np 0d cr 0e so 0f si 10 dle 11 dc1 12 dc2 13 dc3 14 dc4 15 nak 16 syn 17 etb 18 can 19 em 1a sub 1b esc 1c fs 1d gs 1e rs 1f us 20 sp 21! 22 " 23 # 24 \$ 25 % 26 & 27 ' 28 ( 29 ) 2a * 2b + 2c, 2d - 2e. 2f / a : 3b ; 3c < 3d = 3e > 3f? 41 A 42 B 43 C 44 D 45 E 46 F 47 G 48 H 49 I 4a J 4b K 4c L 4d M 4e N 4f O 50 P 51 Q 52 R 53 S 54 T 55 U 56 V 57 W 58 X 59 Y 5a Z 5b [ 5c \ 5d ] 5e ^ 5f _ 60 ` 61 a 62 b 63 c 64 d 65 e 66 f 67 g 68 h 69 i 6a j 6b k 6c l 6d m 6e n 6f o 70 p 71 q 72 r 73 s 74 t 75 u 76 v 77 w 78 x 79 y 7a z 7b { 7c 7d } 7e ~ 7f del Converting a Digit Character to Numeric Suppose ch contains an ascii digit. char ch = an ascii digit; Conversion: int m = ch - '0'; or int n = ch & 0xF; // int arithmetic Examples '6' - '0' = = & F = // hexadecimal 24 Numeral Systems Copyright 2004 by Ken Slonneger

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

plc numbers - 3. Topics: Number bases; binary, octal, decimal, hexadecimal Binary calculations; s compliments, addition, subtraction and Boolean operations Encoded values; BCD and ASCII Error detection;

### Memory is implemented as an array of electronic switches

Memory Structure Memory is implemented as an array of electronic switches Each switch can be in one of two states 0 or 1, on or off, true or false, purple or gold, sitting or standing BInary digits (bits)

### Computer Science 281 Binary and Hexadecimal Review

Computer Science 281 Binary and Hexadecimal Review 1 The Binary Number System Computers store everything, both instructions and data, by using many, many transistors, each of which can be in one of two

### ASCII Code. Numerous codes were invented, including Émile Baudot's code (known as Baudot

ASCII Code Data coding Morse code was the first code used for long-distance communication. Samuel F.B. Morse invented it in 1844. This code is made up of dots and dashes (a sort of binary code). It was

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

ECE Department Summer LECTURE #5: Number Systems EEL : Digital Logic and Computer Systems Based on lecture notes by Dr. Eric M. Schwartz Decimal Number System: -Our standard number system is base, also

### Chapter 5. Binary, octal and hexadecimal numbers

Chapter 5. Binary, octal and hexadecimal numbers A place to look for some of this material is the Wikipedia page http://en.wikipedia.org/wiki/binary_numeral_system#counting_in_binary Another place that

### Chapter 1. Binary, octal and hexadecimal numbers

Chapter 1. Binary, octal and hexadecimal numbers This material is covered in the books: Nelson Magor Cooke et al, Basic mathematics for electronics (7th edition), Glencoe, Lake Forest, Ill., 1992. [Hamilton

### Useful Number Systems

Useful Number Systems Decimal Base = 10 Digit Set = {0, 1, 2, 3, 4, 5, 6, 7, 8, 9} Binary Base = 2 Digit Set = {0, 1} Octal Base = 8 = 2 3 Digit Set = {0, 1, 2, 3, 4, 5, 6, 7} Hexadecimal Base = 16 = 2

### Lecture 2. Binary and Hexadecimal Numbers

Lecture 2 Binary and Hexadecimal Numbers Purpose: Review binary and hexadecimal number representations Convert directly from one base to another base Review addition and subtraction in binary representations

### CSI 333 Lecture 1 Number Systems

CSI 333 Lecture 1 Number Systems 1 1 / 23 Basics of Number Systems Ref: Appendix C of Deitel & Deitel. Weighted Positional Notation: 192 = 2 10 0 + 9 10 1 + 1 10 2 General: Digit sequence : d n 1 d n 2...

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

Chapter 3 3.1 Decimal System The radix or base of a number system determines the total number of different symbols or digits used by that system. The decimal system has a base of 10 with the digits 0 through

### Chapter 1: Digital Systems and Binary Numbers

Chapter 1: Digital Systems and Binary Numbers Digital age and information age Digital computers general purposes many scientific, industrial and commercial applications Digital systems telephone switching

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

EE 261 Introduction to Logic Circuits Module #2 Number Systems Topics A. Number System Formation B. Base Conversions C. Binary Arithmetic D. Signed Numbers E. Signed Arithmetic F. Binary Codes Textbook

### Digital Logic Design. Introduction

Digital Logic Design Introduction A digital computer stores data in terms of digits (numbers) and proceeds in discrete steps from one state to the next. The states of a digital computer typically involve

### Systems I: Computer Organization and Architecture

Systems I: Computer Organization and Architecture Lecture 2: Number Systems and Arithmetic Number Systems - Base The number system that we use is base : 734 = + 7 + 3 + 4 = x + 7x + 3x + 4x = x 3 + 7x

### URL encoding uses hex code prefixed by %. Quoted Printable encoding uses hex code prefixed by =.

ASCII = American National Standard Code for Information Interchange ANSI X3.4 1986 (R1997) (PDF), ANSI INCITS 4 1986 (R1997) (Printed Edition) Coded Character Set 7 Bit American National Standard Code

### Xi2000 Series Configuration Guide

U.S. Default Settings Sequence Reset Scanner Xi2000 Series Configuration Guide Auto-Sense Mode ON UPC-A Convert to EAN-13 OFF UPC-E Lead Zero ON Save Changes POS-X, Inc. 2130 Grant St. Bellingham, WA 98225

### This is great when speed is important and relatively few words are necessary, but Max would be a terrible language for writing a text editor.

Dealing With ASCII ASCII, of course, is the numeric representation of letters used in most computers. In ASCII, there is a number for each character in a message. Max does not use ACSII very much. In the

### Levent EREN levent.eren@ieu.edu.tr A-306 Office Phone:488-9882 INTRODUCTION TO DIGITAL LOGIC

Levent EREN levent.eren@ieu.edu.tr A-306 Office Phone:488-9882 1 Number Systems Representation Positive radix, positional number systems A number with radix r is represented by a string of digits: A n

### Number Representation

Number Representation CS10001: Programming & Data Structures Pallab Dasgupta Professor, Dept. of Computer Sc. & Engg., Indian Institute of Technology Kharagpur Topics to be Discussed How are numeric data

### BARCODE READER V 2.1 EN USER MANUAL

BARCODE READER V 2.1 EN USER MANUAL INSTALLATION OF YOUR DEVICE PS-2 Connection RS-232 Connection (need 5Volts power supply) 1 INSTALLATION OF YOUR DEVICE USB Connection 2 USING THIS MANUAL TO SETUP YOUR

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

Data Representation Section 3.1 Data Types Registers contain either data or control information Control information is a bit or group of bits used to specify the sequence of command signals needed for

### The ASCII Character Set

The ASCII Character Set The American Standard Code for Information Interchange or ASCII assigns values between 0 and 255 for upper and lower case letters, numeric digits, punctuation marks and other symbols.

### Today. Binary addition Representing negative numbers. Andrew H. Fagg: Embedded Real- Time Systems: Binary Arithmetic

Today Binary addition Representing negative numbers 2 Binary Addition Consider the following binary numbers: 0 0 1 0 0 1 1 0 0 0 1 0 1 0 1 1 How do we add these numbers? 3 Binary Addition 0 0 1 0 0 1 1

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

Number Bases //9 Goals Numbers Understand binary and hexadecimal numbers Be able to convert between number bases Understand binary fractions COMP37 Introduction to Computer Architecture Unary Numbers Decimal

### Chapter 4: Computer Codes

Slide 1/30 Learning Objectives In this chapter you will learn about: Computer data Computer codes: representation of data in binary Most commonly used computer codes Collating sequence 36 Slide 2/30 Data

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

Binary Representation The basis of all digital data is binary representation. Binary - means two 1, 0 True, False Hot, Cold On, Off We must be able to handle more than just values for real world problems

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

Digital System Design Prof. D Roychoudhry Department of Computer Science and Engineering Indian Institute of Technology, Kharagpur Lecture - 04 Digital Logic II May, I before starting the today s lecture

### DEBT COLLECTION SYSTEM ACCOUNT SUBMISSION FILE

CAPITAL RESOLVE LTD. DEBT COLLECTION SYSTEM ACCOUNT SUBMISSION FILE (DCS-ASF1107-7a) For further technical support, please contact Clive Hudson (IT Dept.), 01386 421995 13/02/2012 Account Submission File

### 6 3 4 9 = 6 10 + 3 10 + 4 10 + 9 10

Lesson The Binary Number System. Why Binary? The number system that you are familiar with, that you use every day, is the decimal number system, also commonly referred to as the base- system. When you

### Solution for Homework 2

Solution for Homework 2 Problem 1 a. What is the minimum number of bits that are required to uniquely represent the characters of English alphabet? (Consider upper case characters alone) The number of

### Voyager 9520/40 Voyager GS9590 Eclipse 5145

Voyager 9520/40 Voyager GS9590 Eclipse 5145 Quick Start Guide Aller à www.honeywellaidc.com pour le français. Vai a www.honeywellaidc.com per l'italiano. Gehe zu www.honeywellaidc.com für Deutsch. Ir a

### BAR CODE 39 ELFRING FONTS INC.

ELFRING FONTS INC. BAR CODE 39 This package includes 18 versions of a bar code 39 font in scalable TrueType and PostScript formats, a Windows utility, Bar39.exe, that helps you make bar codes, and Visual

### CHAPTER 8 BAR CODE CONTROL

CHAPTER 8 BAR CODE CONTROL CHAPTER 8 BAR CODE CONTROL - 1 CONTENTS 1. INTRODUCTION...3 2. PRINT BAR CODES OR EXPANDED CHARACTERS... 4 3. DEFINITION OF PARAMETERS... 5 3.1. Bar Code Mode... 5 3.2. Bar Code

### ASCII Characters. 146 CHAPTER 3 Information Representation. The sign bit is 1, so the number is negative. Converting to decimal gives

146 CHAPTER 3 Information Representation The sign bit is 1, so the number is negative. Converting to decimal gives 37A (hex) = 134 (dec) Notice that the hexadecimal number is not written with a negative

### Lecture 11: Number Systems

Lecture 11: Number Systems Numeric Data Fixed point Integers (12, 345, 20567 etc) Real fractions (23.45, 23., 0.145 etc.) Floating point such as 23. 45 e 12 Basically an exponent representation Any number

### Symbols in subject lines. An in-depth look at symbols

An in-depth look at symbols What is the advantage of using symbols in subject lines? The age of personal emails has changed significantly due to the social media boom, and instead, people are receving

### Section 1.4 Place Value Systems of Numeration in Other Bases

Section.4 Place Value Systems of Numeration in Other Bases Other Bases The Hindu-Arabic system that is used in most of the world today is a positional value system with a base of ten. The simplest reason

### BI-300. Barcode configuration and commands Manual

BI-300 Barcode configuration and commands Manual 1. Introduction This instruction manual is designed to set-up bar code scanner particularly to optimize the function of BI-300 bar code scanner. Terminal

### Binary Representation

Binary Representation The basis of all digital data is binary representation. Binary - means two 1, 0 True, False Hot, Cold On, Off We must tbe able to handle more than just values for real world problems

### NUMBER SYSTEMS. 1.1 Introduction

NUMBER SYSTEMS 1.1 Introduction There are several number systems which we normally use, such as decimal, binary, octal, hexadecimal, etc. Amongst them we are most familiar with the decimal number system.

### COMPSCI 210. Binary Fractions. Agenda & Reading

COMPSCI 21 Binary Fractions Agenda & Reading Topics: Fractions Binary Octal Hexadecimal Binary -> Octal, Hex Octal -> Binary, Hex Decimal -> Octal, Hex Hex -> Binary, Octal Animation: BinFrac.htm Example

### Lecture 8: Binary Multiplication & Division

Lecture 8: Binary Multiplication & Division Today s topics: Addition/Subtraction Multiplication Division Reminder: get started early on assignment 3 1 2 s Complement Signed Numbers two = 0 ten 0001 two

### ASCII CODES WITH GREEK CHARACTERS

ASCII CODES WITH GREEK CHARACTERS Dec Hex Char Description 0 0 NUL (Null) 1 1 SOH (Start of Header) 2 2 STX (Start of Text) 3 3 ETX (End of Text) 4 4 EOT (End of Transmission) 5 5 ENQ (Enquiry) 6 6 ACK

### NUMBER SYSTEMS. William Stallings

NUMBER SYSTEMS William Stallings The Decimal System... The Binary System...3 Converting between Binary and Decimal...3 Integers...4 Fractions...5 Hexadecimal Notation...6 This document available at WilliamStallings.com/StudentSupport.html

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

Binary Numbers In computer science we deal almost exclusively with binary numbers. it will be very helpful to memorize some binary constants and their decimal and English equivalents. By English equivalents

### Binary Numbers. Binary Octal Hexadecimal

Binary Numbers Binary Octal Hexadecimal Binary Numbers COUNTING SYSTEMS UNLIMITED... Since you have been using the 10 different digits 0, 1, 2, 3, 4, 5, 6, 7, 8, and 9 all your life, you may wonder how

### 1. Give the 16 bit signed (twos complement) representation of the following decimal numbers, and convert to hexadecimal:

Exercises 1 - number representations Questions 1. Give the 16 bit signed (twos complement) representation of the following decimal numbers, and convert to hexadecimal: (a) 3012 (b) - 435 2. For each of

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

LSN 2 Number Systems Department of Engineering Technology LSN 2 Decimal Number System Decimal number system has 10 digits (0-9) Base 10 weighting system... 10 5 10 4 10 3 10 2 10 1 10 0. 10-1 10-2 10-3

### Counting in base 10, 2 and 16

Counting in base 10, 2 and 16 1. Binary Numbers A super-important fact: (Nearly all) Computers store all information in the form of binary numbers. Numbers, characters, images, music files --- all of these

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

2/9/9 Binary number system Computer (electronic) systems prefer binary numbers Binary number: represent a number in base-2 Binary numbers 2 3 + 7 + 5 Some terminology Bit: a binary digit ( or ) Hexadecimal

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

CDA 3200 Digital Systems Instructor: Dr. Janusz Zalewski Developed by: Dr. Dahai Guo Spring 2012 Outline Data Representation Binary Codes Why 6-3-1-1 and Excess-3? Data Representation (1/2) Each numbering

### CPEN 214 - Digital Logic Design Binary Systems

CPEN 4 - Digital Logic Design Binary Systems C. Gerousis Digital Design 3 rd Ed., Mano Prentice Hall Digital vs. Analog An analog system has continuous range of values A mercury thermometer Vinyl records

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

Conversions Dr. Sarita Agarwal (Acharya Narendra Dev College,University of Delhi) INTRODUCTION System- A number system defines a set of values to represent quantity. We talk about the number of people

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

CS101 Lecture 11: Number Systems and Binary Numbers Aaron Stevens 14 February 2011 1 2 1 3!!! MATH WARNING!!! TODAY S LECTURE CONTAINS TRACE AMOUNTS OF ARITHMETIC AND ALGEBRA PLEASE BE ADVISED THAT CALCULTORS

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

Digital Design Assoc. Prof. Dr. Berna Örs Yalçın Istanbul Technical University Faculty of Electrical and Electronics Engineering Office Number: 2318 E-mail: siddika.ors@itu.edu.tr Grading 1st Midterm -

### Chapter Binary, Octal, Decimal, and Hexadecimal Calculations

Chapter 5 Binary, Octal, Decimal, and Hexadecimal Calculations This calculator is capable of performing the following operations involving different number systems. Number system conversion Arithmetic

### UIL Computer Science for Dummies by Jake Warren and works from Mr. Fleming

UIL Computer Science for Dummies by Jake Warren and works from Mr. Fleming 1 2 Foreword First of all, this book isn t really for dummies. I wrote it for myself and other kids who are on the team. Everything

### Unsigned Conversions from Decimal or to Decimal and other Number Systems

Page 1 of 5 Unsigned Conversions from Decimal or to Decimal and other Number Systems In all digital design, analysis, troubleshooting, and repair you will be working with binary numbers (or base 2). It

### The science of computing

The science of computing first edition by Carl Burch Copyright c 2004, by Carl Burch. This publication may be redistributed, in part or in whole, provided that this page is included. A complete version,

### Chapter 7D The Java Virtual Machine

This sub chapter discusses another architecture, that of the JVM (Java Virtual Machine). In general, a VM (Virtual Machine) is a hypothetical machine (implemented in either hardware or software) that directly

### Base Conversion written by Cathy Saxton

Base Conversion written by Cathy Saxton 1. Base 10 In base 10, the digits, from right to left, specify the 1 s, 10 s, 100 s, 1000 s, etc. These are powers of 10 (10 x ): 10 0 = 1, 10 1 = 10, 10 2 = 100,

### Model 200 / 250 / 260 Programming Guide

Model 200 / 250 / 260 Programming Guide E-SEEK Inc. R & D Center 9471 Ridgehaven Court #E San Diego, CA 92123 Tel: 858-495-1900 Fax: 858-495-1901 Sales & Marketing 245 Fischer Ave #D5 Costa Mesa, CA 92626

### TELOCATOR ALPHANUMERIC PROTOCOL (TAP)

TELOCATOR ALPHANUMERIC PROTOCOL (TAP) Version 1.8 February 4, 1997 TABLE OF CONTENTS 1.0 Introduction...1 2.0 TAP Operating Environment...1 3.0 Recommended Sequence Of Call Delivery From An Entry Device...2

### Characters & Strings Lesson 1 Outline

Outline 1. Outline 2. Numeric Encoding of Non-numeric Data #1 3. Numeric Encoding of Non-numeric Data #2 4. Representing Characters 5. How Characters Are Represented #1 6. How Characters Are Represented

### Name: Class: Date: 9. The compiler ignores all comments they are there strictly for the convenience of anyone reading the program.

Name: Class: Date: Exam #1 - Prep True/False Indicate whether the statement is true or false. 1. Programming is the process of writing a computer program in a language that the computer can respond to

### MIPS Assembly Language Programming CS50 Discussion and Project Book. Daniel J. Ellard

MIPS Assembly Language Programming CS50 Discussion and Project Book Daniel J. Ellard September, 1994 Contents 1 Data Representation 1 1.1 Representing Integers........................... 1 1.1.1 Unsigned

### INTERNATIONAL STANDARD

INTERNATIONAL STANDARD ISO/IEC 18004 First edition 2000-06-15 Information technology Automatic identification and data capture techniques Bar code symbology QR Code Technologies de l'information Techniques

### Create!form Barcodes. User Guide

Create!form Barcodes User Guide Barcodes User Guide Version 6.3 Copyright Bottomline Technologies, Inc. 2008. All Rights Reserved Printed in the United States of America Information in this document is

### Representação de Caracteres

Representação de Caracteres IFBA Instituto Federal de Educ. Ciencia e Tec Bahia Curso de Analise e Desenvolvimento de Sistemas Introdução à Ciência da Computação Prof. Msc. Antonio Carlos Souza Coletânea

### Command Emulator STAR Line Mode Command Specifications

Line Thermal Printer Command Emulator STAR Line Mode Command Specifications Revision 0.01 Star Micronics Co., Ltd. Special Products Division Table of Contents 1. Command Emulator 2 1-1) Command List 2

### Part No. : MUL-53221-07 PROGRAMMING GUIDE

Part No. : MUL-53221-07 PROGRAMMING GUIDE PROGRAMMING GUIDE for BARCODE SCANNERS The guide can be used as keyboard emulation, RS- 232C serial interface, and USB 1.1 interface and wand emulation. IMPORTANT

### Number Systems and Radix Conversion

Number Systems and Radix Conversion Sanjay Rajopadhye, Colorado State University 1 Introduction These notes for CS 270 describe polynomial number systems. The material is not in the textbook, but will

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

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

### 3. Convert a number from one number system to another

3. Convert a number from one number system to another Conversion between number bases: Hexa (16) Decimal (10) Binary (2) Octal (8) More Interest Way we need conversion? We need decimal system for real

### Positional Numbering System

APPENDIX B Positional Numbering System A positional numbering system uses a set of symbols. The value that each symbol represents, however, depends on its face value and its place value, the value associated

### HOMEWORK # 2 SOLUTIO

HOMEWORK # 2 SOLUTIO Problem 1 (2 points) a. There are 313 characters in the Tamil language. If every character is to be encoded into a unique bit pattern, what is the minimum number of bits required to

### Security Protection of Software Programs by Information Sharing and Authentication Techniques Using Invisible ASCII Control Codes

International Journal of Network Security, Vol.10, No.1, PP.1 10, Jan. 2010 1 Security Protection of Software Programs by Information Sharing and Authentication Techniques Using Invisible ASCII Control

### Binary, Hexadecimal, Octal, and BCD Numbers

23CH_PHCalter_TMSETE_949118 23/2/2007 1:37 PM Page 1 Binary, Hexadecimal, Octal, and BCD Numbers OBJECTIVES When you have completed this chapter, you should be able to: Convert between binary and decimal

### Barcode Magstripe. Decoder & Scanner. Programming Manual

Barcode Magstripe Decoder & Scanner Programming Manual CONTENTS Getting Started... 2 Setup Procedures... 3 Setup Flow Chart...4 Group 0 : Interface Selection... 5 Group 1 : Device Selection for keyboard

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

1 Topics Machine Architecture and Number Systems Major Computer Components Bits, Bytes, and Words The Decimal Number System The Binary Number System Converting from Decimal to Binary Major Computer Components

### BRMO 80 / ETH-IP. User Manual. Réf : MU-BRMO 80-ETH-IP-1.4-EN

User Manual Réf : MU-BRMO 80-ETH-IP-1.4-EN BALOGH SA 189, rue d Aubervilliers - C.P. 97 75886 PARIS Cedex 18 France Tél : 33 (0)1 44 65 65 00 Fax : 33 (0)1 44 65 65 10 e-mail : balogh@balogh-group.com

### ELEG3924 Microprocessor Ch.7 Programming In C

Department of Electrical Engineering University of Arkansas ELEG3924 Microprocessor Ch.7 Programming In C Dr. Jingxian Wu wuj@uark.edu OUTLINE 2 Data types and time delay I/O programming and Logic operations

### Pemrograman Dasar. Basic Elements Of Java

Pemrograman Dasar Basic Elements Of Java Compiling and Running a Java Application 2 Portable Java Application 3 Java Platform Platform: hardware or software environment in which a program runs. Oracle

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

Decimal Division Remember 4th grade long division? 43 // quotient 12 521 // divisor dividend -480 41-36 5 // remainder Shift divisor left (multiply by 10) until MSB lines up with dividend s Repeat until

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

Today s topics! Binary Numbers! Brookshear.-.! Slides from Prof. Marti Hearst of UC Berkeley SIMS! Upcoming! Networks Interactive Introduction to Graph Theory http://www.utm.edu/cgi-bin/caldwell/tutor/departments/math/graph/intro

### 7-Bit coded Character Set

Standard ECMA-6 6 th Edition - December 1991 Reprinted in electronic form in August 1997 Standardizing Information and Communication Systems 7-Bit coded Character Set Phone: +41 22 849.60.00 - Fax: +41

### DNA Data and Program Representation. Alexandre David 1.2.05 adavid@cs.aau.dk

DNA Data and Program Representation Alexandre David 1.2.05 adavid@cs.aau.dk Introduction Very important to understand how data is represented. operations limits precision Digital logic built on 2-valued

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

Binary numbers The reason humans represent numbers using decimal (the ten digits from 0,1,... 9) is that we have ten fingers. There is no other reason than that. There is nothing special otherwise about

### BINARY CODED DECIMAL: B.C.D.

BINARY CODED DECIMAL: B.C.D. ANOTHER METHOD TO REPRESENT DECIMAL NUMBERS USEFUL BECAUSE MANY DIGITAL DEVICES PROCESS + DISPLAY NUMBERS IN TENS IN BCD EACH NUMBER IS DEFINED BY A BINARY CODE OF 4 BITS.

### Number and codes in digital systems

Number and codes in digital systems Decimal Numbers You are familiar with the decimal number system because you use them everyday. But their weighted structure is not understood. In the decimal number

### ESPA 4.4.4 Nov 1984 PROPOSAL FOR SERIAL DATA INTERFACE FOR PAGING EQUIPMENT CONTENTS 1. INTRODUCTION 2. CHARACTER DESCRIPTION

PROPOSAL FOR SERIAL DATA INTERFACE FOR PAGING EQUIPMENT CONTENTS 1. INTRODUCTION 2. CHARACTER DESCRIPTION 2.1 CHARACTER STRUCTURE 2.2 THE CHARACTER SET 2.3 CONTROL CHARACTERS 2.3.1 Transmission control

### Informatica e Sistemi in Tempo Reale

Informatica e Sistemi in Tempo Reale Introduction to C programming Giuseppe Lipari http://retis.sssup.it/~lipari Scuola Superiore Sant Anna Pisa October 25, 2010 G. Lipari (Scuola Superiore Sant Anna)

### Numbering Systems. InThisAppendix...

G InThisAppendix... Introduction Binary Numbering System Hexadecimal Numbering System Octal Numbering System Binary Coded Decimal (BCD) Numbering System Real (Floating Point) Numbering System BCD/Binary/Decimal/Hex/Octal

### Verilog - Representation of Number Literals

Verilog - Representation of Number Literals... And here there be monsters! (Capt. Barbossa) Numbers are represented as: value ( indicates optional part) size The number of binary

### 1. Convert the following base 10 numbers into 8-bit 2 s complement notation 0, -1, -12

C5 Solutions 1. Convert the following base 10 numbers into 8-bit 2 s complement notation 0, -1, -12 To Compute 0 0 = 00000000 To Compute 1 Step 1. Convert 1 to binary 00000001 Step 2. Flip the bits 11111110

### Technical Support Bulletin Nr.18 Modbus Tips

Technical Support Bulletin Nr.18 Modbus Tips Contents! Definitions! Implemented commands! Examples of commands or frames! Calculating the logical area! Reading a signed variable! Example of commands supported