EE 261 Introduction to Logic Circuits. Module #2 Number Systems
|
|
|
- Hector Riley
- 9 years ago
- Views:
Transcription
1 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 Reading Assignments Practice Problems 2.1, 2.5, 2.6, 2.7, 2.8, 2.11, 2.12 Graded Components of this Module 2 homeworks, 2 discussions, 1 quiz (all online) Page 1
2 EE 261 Introduction to Logic Circuits Module #2 Number Systems What you should be able to do after this module Convert numbers between bases (decimal, binary, octal, hexadecimal) Perform arithmetic (both signed & unsigned) using other bases Create and Decode various binary codes (BCD, Gray, ASCII, Parity) Page 2
3 Number Systems Number System - a system that contains a set of numbers/symbols/characters and at least one operation (+, -, ) BASE or RADIX - the number of symbols in the number system - humans use Base10 (why?) - computers use Base2 (why?) Positional Number System - we can represent 10 unique quantities w/ our Base10 system - what if we want more? - we can add a "leading" digit to our number that has increased "weight ex) 0 1 : : Page 3
4 Number Systems Radix Point - place in the string of digits at which numbers represent either whole or fractional. ex) p - Number of digits to the LEFT of the radix point. n - Number of digits to the RIGHT of the radix point. d - Digits in the system, described with a positional subscript (NOTE: if the radix point is missing, we assume it is to the right of the #) r - Radix or Base (Base10, r=10) i - Position - starting at 0 - increasing to the left of the radix point - negative to the right of the radix point Weight - each digit has a weight based on its position = r i - we multiply the digit by its weight to find how much value that digit represents Page 4
5 Number Systems Value - the value of a number is the sum of each digit multiplied by its corresponding weight. D i p 1 n i d i r Example: Given the BASE 10 (r=10) number What is p? p=3 What is n? n=1 Write the digit notation? d 2 d 1 d 0. d -1 What is the weight for each position? Show the expanded decimal equivalent? = 3(10 2 ) + 2(10 1 ) +7(10 0 ) + 2(10-1 ) = Why all this framework? Because this generic format works for all Bases. Page 5
6 Number Systems Binary - A number system with 2 symbols (BASE=2 or r=2). - The symbols are 0 and 1 - each symbol is called a "bit" - we ll give a subscript to the number to indicate its base ex) (decimal) (binary) - 4 bits are called a "Nibble" - 8 bits are called a "Byte" - the leftmost bit in a string is called the Most Significant (MSB) or High Order - the rightmost bit in a string is called the Least Significant (LSB) or Low Order Page 6
7 Number Systems Binary Systems B p 1 i b i r i n Example: Given the Binary number What is p? p=5 What is n? n=0 What is r? r=2 Write the bit notation? b 4 b 3 b 2 b 1 b 0 What is the weight for each position? Show the expanded decimal equivalent? B = 1(2 4 ) + 0(2 3 ) +0(2 2 ) + 1(2 1 ) + 1(2 0 ) = 1(16) + 0(8) + 0(4) + 1(2) +1(1) = Page 7
8 Base Conversions Base - the number of symbols in a number system - we instinctively know decimal - we've talked about Binary (two symbol) - there are other bases of interest in digital systems - the bases we typically care about are powers of 2 (or associated with Binary) - these bases are typically used to represent a lot of "bits" ex) it's hard to describe the value of a 64-bit bus in 1's and 0's Octal - A number system with 8 symbols - 0,1,2,3,4,5,6,7 - each digit in this system is equivalent to 3-bits - it is a positional number system ex) 0 1 : : Page 8
9 Base Conversions Hexadecimal - A number system with 16 symbols - we use alphabetic characters as symbols in the set above 9-0,1,2,3,4,5,6,7,8,9,A,B,C,D,E,F - each digit in this system is equivalent to 4-bits - it is a positional number system ex) 0 1 : 9 A B C D E F : 1F 20 : Page 9
10 Base Conversions How the Bases Relate to Each Other Decimal Binary Octal Hexadecimal Base10 Base2 Base8 Base A B C D E F - these are the commonly used bases in digital systems, we'd like to be able to convert between them Page 10
11 Base Conversions Converting to Decimal - we sum the products of each digit value with its positional weight D i p 1 n i d i r - this works for whole and fractional digits - this works for Binary to Decimal - this works for Octal to Decimal - this works for Hex to Decimal Page 11
12 Base Conversions Base Conversion Binary to Decimal - each digit has a weight of r i that depends on the position of the digit - multiply each digit by its weight - sum the resultant products ex) Convert 1011 to decimal (weight) = 1 (2 3 ) + 0 (2 2 ) + 1 (2 1 ) + 1 (2 0 ) = 1 (8) + 0 (4) + 1 (2) + 1 (1) = = 11 Decimal Page 12
13 Base Conversions Base Conversion Binary to Decimal with Fractions - the weight of the binary digits have negative positions ex) Convert to decimal = 1 (2 3 ) + 0 (2 2 ) + 1 (2 1 ) + 1 (2 0 ) + 1 (2-1 ) + 0 (2-2 ) + 1 (2-3 ) = 1 (8) + 0 (4) + 1 (2) + 1 (1) + 1 (0.5) + 0 (0.25) + 1 (0.125) = = Decimal Page 13
14 Base Conversions Base Conversion Hex to Decimal - the same process as binary to decimal except the weights are now BASE 16 - NOTE (A=10, B=11, C=12, D=13, E=14, F=15) ex) Convert 2BC from Hex to decimal (weight) 2 B C = 2 (16 2 ) + B (16 1 ) + C (16 0 ) = 2 (256) + 11 (16) + 12 (1) = = 700 Decimal Page 14
15 Base Conversions Base Conversion Hex to Decimal with Fractions - the fractional digits have negative weights (BASE 16) - NOTE (A=10, B=11, C=12, D=13, E=14, F=15) ex) Convert 2BC.F to decimal (weight) 2 B C. F = 2 (16 2 ) + B (16 1 ) + C (16 0 ) + F (16-1 ) = 2 (256) + 11 (16) + 12 (1) + 15 (0.0625) = = Decimal Page 15
16 Base Conversions Base Conversion Decimal to Binary - the decimal number is divided by 2, the remainder is recorded - the quotient is then divided by 2, the remainder is recorded - the process is repeated until the quotient is zero ex) Convert 11 decimal to binary Quotient Remainder LSB MSB = 1011 binary Page 16
17 Base Conversions Base Conversion Decimal to Binary with Fractions - the fraction is converted to binary separately - the fraction is multiplied by 2, the 0 th position digit is recorded - the remaining fraction is multiplied by 2, the 0 th digit is recorded - the process is repeated until the fractional part is zero ex) Convert decimal to binary Product 0 th Digit MSB LSB finished decimal = binary Page 17
18 Base Conversions Base Conversion Decimal to Hex - the same procedure is used as before but with BASE 16 as the divisor/multiplier ex) Convert decimal to hex 1 st, convert the integer part Quotient Remainder LSB MSB 2 nd, convert the fractional part = 1A4 Product 0 th Digit MSB decimal = 1A4.A hexadecimal = 0.A Page 18
19 Base Conversions Base Conversion Octal to Decimal / Decimal to Octal - the same procedure is used as before but with BASE 8 as the divisor/multiplier Page 19
20 Base Conversions Base Conversion of "Powers of 2" - converting bases that are powers of 2 are simple due to straight forward mapping - An Octal digital represents 3 bits - A Hex digit represents 4 bits Page 20
21 Base Conversions Converting Binary to Hexadecimal - every 4 binary bits represents one HEX digit - begin the groups of four at the LSB - if necessary, fill with leading 0 s to form the groups of four ex) Convert from Binary to Hex D 4 Hex, notice that we had to fill with MSB 0's to get groups of four - This works for fractions too. The only difference is that the grouping starts at the Radix Point ex) Convert 0.11 from Binary to Octal C Page 21
22 Base Conversions Converting Binary to Octal - every 3 binary bits represents one OCTAL digit - begin the groups of three at the LSB - if necessary, fill with leading 0 s to form the groups of three ex) Convert from Binary to Octal Octal ex) Convert from Binary to Octal Octal, note we had to fill with 0's on the MSB side Page 22
23 Base Conversions Converting Hex to Binary - each HEX digit is made up of four binary bits ex) Convert ABC Hex to Binary A B C = = Page 23
24 Base Conversions Converting Octal to Binary - each Octal digit is made up of three binary bits ex) Convert 567 Octal to Binary = = Page 24
25 Base Conversions Terminology NIBBLE BYTE = 4 bits = 8 bits - you should be familiar with converting Binary Nibbles to Hex & Dec - there is a table on page 28 of your textbook which lists the basic conversions Page 25
26 Binary Arithmetic Addition and Subtraction - same as BASE 10 math, remember borrows and carries Addition Table Carry Subtraction Table Need to "Borrow" from a more significant bit Page 26
27 Binary Arithmetic Binary Addition - same as BASE 10 addition - need to keep track of the carry bit for a given system size (n), i.e., 4-bit, 8-bit, 16-bit, ex) Add the binary numbers 1011 and Carry Bit Page 27
28 Binary Arithmetic Binary Subtraction - same as BASE 10 subtraction - need to keep track of the borrow bit for a given system size (n), i.e., 4-bit, 8-bit, 16-bit, ex) Subtract the binary numbers 1010 and Borrow bits : if necessary, we could assume a borrow from an even higher significant bit Page 28
29 Signed Numbers Negative Numbers - So far, we've dealt with Positive numbers - The real world has Negative numbers - We need a method to represent negatives in binary - However, our number system doesn't have a "-", just 0's and 1's Sign Bit - We will use the MSB to represent a "+" or "-" 0 = Positive 1 = Negative Page 29
30 Signed Numbers Signed Magnitude Representation - a negative number system (there is more than one) - uses the MSB as the sign bit - the remaining LSB's represent the number ex) 85 dec = dec = (additional sign bit adds one bit to the number) -85 dec = Is this Efficient? - The number of unique combinations that a number can represents is given by: N = r x N = # of unique combinations x = # of digits in the number (p + n) r = base ex) 2-bits: N=2 2 = 4 (00, 01, 10, 11) 7-bits: N=2 7 = bits: N=2 8 = 256 Page 30
31 Signed Numbers Signed Magnitude Range - The Range of Signed Magnitude is given by: -(2 x-1-1) < N SM < (2 x-1-1) ex) if we use 8-bits, the range is: -( ) < N SM < ( ) -127 < N SM < This is only 255 unique numbers - But, if we are using 8-bits, there should be 2 8 unique numbers, or 256? - This is because in Signed Magnitude, there are two representations for Zero = = -0 Page 31
32 Signed Numbers Advantages of Signed Magnitude - Very easy to understand and use - the binary number is simply represented in binary, then a sign bit is added Disadvantages of Signed Magnitude Representation - We loose a possible number by having +0, and This also creates a gap in our number list, which makes simple math harder - Addition/Subtraction in general are more difficult Algorithm : if ( signs are the same) - add and give same sign else if (signs are different) - compare magnitudes - subtract smaller from larger - give the result the sign of larger number Page 32
33 Signed Numbers Complement Numbers - Complementing a Binary Number means: 0 changes to 1 1 changes to 0 - using this technique, number can be a "complemented" to find the negative representation, then the arithmetic becomes much simpler - the ones we care about are 1) "Radix Complement" (2's complement for binary) 2) "1's Complement Page 33
34 Signed Numbers Radix Complement - i.e., 10's complement, 2's complement - Technique to get the Radix Complement: - subtract current number from r x D r-comp = r n - D orig - Rules: - The MSB is still the sign bit (0="+", 1="-") - Now that we're subtracting, we can't have arbitrary number of bits x is predetermined and fixed - A simpler method is : 1) Complement all digits in D orig 2) Add 1 to the result, ignore any carry-out Page 34
35 Signed Numbers 2's Complement - this is Radix Complement on a BASE2 number system - straight forward to use the "complement and add 1" technique ex) Give the 8-bit, 2's complement representation of = (Notice that the MSB is the sign bit, 0=+) Step 1: (we first complement all bits) Step 2: + 1 (we then add 1) (Notice the Sign Bit is negative) - these 8-bits represent in 2's complement Page 35
36 Signed Numbers 2's Complement Checking - We can convert back to find Original magnitude and do checking ex) Give the 8-bit, 2's complement representation of = 's Comp (Notice that the MSB is the sign bit, 1="-") Step 1: (we first complement all bits) Step 2: + 1 (we then add 1) (Notice the Sign Bit is positive) - these 8-bits represent ,Which is what we originally started with, Page 36
37 Signed Numbers 2's Complement Range - We need to know how many numbers we can represent using this system - Notice that we are still using a bit for the sign - BUT, we don't duplicate Zero in this system ex) = = The Range of 2's Comp is given by: -(2 x-1 ) < N 2Comp < (2 x-1-1) ex) if we use 8-bits, the range is: -(2 8-1 ) < N 2Comp < ( ) -128 < N 2Comp < There are now 256 unique numbers, this is a more efficient use of bits Page 37
38 Signed Numbers 1's Complement - In 2's complement, the codes are asymmetric Lowest 2's Comp # = Comp = Highest 2's Comp # = Comp = This is good because we have all 256 possible numbers that 8-bits can give us - 1's Comp is similar, but it gives us symmetry around Zero - To find the 1's Comp, we subtract current number from (r x -1) D 1Comp = (r n -1) - D orig Page 38
39 Signed Numbers 1's Complement - Or we can use the simple way 1) Complement all the #'s (Don't add 1) ex) Give the 8-bit, 1's complement representation of = (Notice that the MSB is the sign bit, 0=+) Step 1: Comp (complement all bits) Page 39
40 Signed Numbers 1's Complement Range - The Range of 1's Complement is given by: -(2 x-1-1) < N SM < (2 x-1-1) - Once again, we have two values for Zero = = -0 Page 40
41 Signed Numbers Negative Representation - We have covered 3 different "signed" codes - You need to KNOW THE CODE you are using ex) Represent ) Signed Magnitude : SM 2) 2's Complement : Comp 3) 1's Complement : Comp Page 41
42 Signed Arithmetic Two s Compliment Arithmetic - Two's complement has advantages when going into Hardware - Two's complement addition is straight forward because the numbers are in sequential order (+1) from their least significant ( ) to their most significant ( ) - There is only one value for Zero, so "avoiding the gap" isn't necessary Page 42
43 Signed Arithmetic Two s Compliment Addition - Addition of two s compliment numbers is performed just like standard binary addition. - However, the carry bit is ignored Page 43
44 Signed Arithmetic Two s Compliment Subtraction - We can build a subtraction circuit out of the same hardware as an adder - 2's Comp inherently adds negative numbers so - to subtract, we can just complement one number, and add it. ex) Subtract 8dec from 15dec 15dec = dec = > two s compliment -> invert add = -8dec Now Add: 15 + (-8) = % % = 7dec Disregard Carry Page 44
45 Signed Arithmetic Two s Compliment Overflow - If a two s compliment arithmetic operation results in a number that is outside the range of representation (i.e., 8bits : -128 < N < +127), an overflow has occurred. ex) -100dec 100dec- = -200dec (can t represent) - There are three cases when overflow occurs 1) Sum of like signs results in answer with opposite sign 2) Negative Positive = Positive 3) Positive Negative = Negative - Boolean logic can be used to detect these situations. Page 45
46 Signed Arithmetic Remember 2's Comp Range - The Range of 2's Comp is given by: -(2 x-1 ) < N 2Comp < (2 x-1-1) ex) if we use 8-bits, the range is: -(2 8-1 ) < N 2Comp < ( ) -128 < N 2Comp < +127 What goes on in real Hardware? - A generic, Binary adder circuit is created - the user must be aware of when 2's complement is being used - additional circuitry checks for "Overflow" Page 46
47 Binary Codes Codes - a string of x-bits that represent information - we've seen codes already using the binary # system 1) Signed Magnitude 2) 2's Complement 3) 1's Complement - the same information can be encoded differently - it's up to the engineer to KNOW THE CODE that is being used Code Word - the term to represent the discrete string of bits that make up the information ex) 4-bit code words in a stream of information word Page 47
48 Binary Codes Binary Coded Decimal (BCD) - Sometimes we wish to represent an individual decimal digit as a binary representation (i.e., 7-segment display to eliminate a decoder) - We do this by using 4 binary digits. Decimal BCD ex) Represent 17dec Binary = BCD = Page 48
49 Binary Codes BCD Addition - If we are using BCD, traditional addition doesn t work. 12 = correct answer in BCD is 20. Traditional addition only considers bit addition carry. In BCD we need to consider 4-bit addition carry. 1A - The solution is to add 6 to every sum greater than 9 12 = When a nibble addition results in A or greater, we add A Page 49
50 Binary Codes Gray Code - There are applications where we want to count, but we only want one bit to transition each time we increment counts - Reduce Power & Noise in Digital Electronics - Electromechanical devices - Such a is called a "Gray Code" ex) 3-bit Gray Code Decimal Binary Gray Page 50
51 Binary Codes ASCII - American Standard Code for Information Interchange - English Alphanumeric characters are represented with a 7-bit code - See Table 2-11 in text ex) A = $40 a = $61 Page 51
52 Binary Codes Parity Codes - there are times when information can be corrupted during transmission - we can include an "Error Checking" bit along with the original data - this "Error Checking" bit contains additional information about the original data - this can be used by the receiver to monitor whether an error in the data occurred PARITY - the number of 1's in the information are counted, - the parity bit represents whether there are an EVEN or ODD number of 1's EVEN PARITY = 0, if there are an EVEN number of 1's in the information = 1, otherwise ODD PARITY = 0, if there are an ODD number of 1's in the information = 1, otherwise Page 52
53 Binary Codes Parity Example Information EVEN Parity ODD Parity Page 53
54 Module Overview Topics - # systems & bases - # system conversions - to & from decimal - to and from binary/oct/hex - binary arithmetic - addition (carries) - subtraction (borrows) - negative #'s in binary - Signed Magnitude - 2's Complement - 1's Complement - 2's complement arithmetic - complement & add - range & overflow - Codes - BCD, Gray, ASCII, Parity Page 54
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
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
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
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;
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
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
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
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
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: [email protected] Grading 1st Midterm -
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
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
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...
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
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
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
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
Levent EREN [email protected] A-306 Office Phone:488-9882 INTRODUCTION TO DIGITAL LOGIC
Levent EREN [email protected] 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
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
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
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
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
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
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
Number Systems. Introduction / Number Systems
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
Chapter 2. Binary Values and Number Systems
Chapter 2 Binary Values and Number Systems Numbers Natural numbers, a.k.a. positive integers Zero and any number obtained by repeatedly adding one to it. Examples: 100, 0, 45645, 32 Negative numbers A
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.
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,
CS201: Architecture and Assembly Language
CS201: Architecture and Assembly Language Lecture Three Brendan Burns CS201: Lecture Three p.1/27 Arithmetic for computers Previously we saw how we could represent unsigned numbers in binary and how binary
Numeral Systems. The number twenty-five can be represented in many ways: Decimal system (base 10): 25 Roman numerals:
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
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
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
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
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
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
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
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
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
COMBINATIONAL CIRCUITS
COMBINATIONAL CIRCUITS http://www.tutorialspoint.com/computer_logical_organization/combinational_circuits.htm Copyright tutorialspoint.com Combinational circuit is a circuit in which we combine the different
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
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
Digital codes. Resources and methods for learning about these subjects (list a few here, in preparation for your research):
Digital codes This worksheet and all related files are licensed under the Creative Commons Attribution License, version 1.0. To view a copy of this license, visit http://creativecommons.org/licenses/by/1.0/,
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.
Chapter 7 Lab - Decimal, Binary, Octal, Hexadecimal Numbering Systems
Chapter 7 Lab - Decimal, Binary, Octal, Hexadecimal Numbering Systems This assignment is designed to familiarize you with different numbering systems, specifically: binary, octal, hexadecimal (and decimal)
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
Divide: Paper & Pencil. Computer Architecture ALU Design : Division and Floating Point. Divide algorithm. DIVIDE HARDWARE Version 1
Divide: Paper & Pencil Computer Architecture ALU Design : Division and Floating Point 1001 Quotient Divisor 1000 1001010 Dividend 1000 10 101 1010 1000 10 (or Modulo result) See how big a number can be
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
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
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
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
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
Binary Adders: Half Adders and Full Adders
Binary Adders: Half Adders and Full Adders In this set of slides, we present the two basic types of adders: 1. Half adders, and 2. Full adders. Each type of adder functions to add two binary bits. In order
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
A Step towards an Easy Interconversion of Various Number Systems
A towards an Easy Interconversion of Various Number Systems Shahid Latif, Rahat Ullah, Hamid Jan Department of Computer Science and Information Technology Sarhad University of Science and Information Technology
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
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
Understanding Logic Design
Understanding Logic Design ppendix of your Textbook does not have the needed background information. This document supplements it. When you write add DD R0, R1, R2, you imagine something like this: R1
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
PROGRAMMABLE LOGIC CONTROLLERS Unit code: A/601/1625 QCF level: 4 Credit value: 15 TUTORIAL OUTCOME 2 Part 1
UNIT 22: PROGRAMMABLE LOGIC CONTROLLERS Unit code: A/601/1625 QCF level: 4 Credit value: 15 TUTORIAL OUTCOME 2 Part 1 This work covers part of outcome 2 of the Edexcel standard module. The material is
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
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
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
United States Naval Academy Electrical and Computer Engineering Department. EC262 Exam 1
United States Naval Academy Electrical and Computer Engineering Department EC262 Exam 29 September 2. Do a page check now. You should have pages (cover & questions). 2. Read all problems in their entirety.
Sistemas Digitais I LESI - 2º ano
Sistemas Digitais I LESI - 2º ano Lesson 6 - Combinational Design Practices Prof. João Miguel Fernandes ([email protected]) Dept. Informática UNIVERSIDADE DO MINHO ESCOLA DE ENGENHARIA - PLDs (1) - The
Cyber Security Workshop Encryption Reference Manual
Cyber Security Workshop Encryption Reference Manual May 2015 Basic Concepts in Encoding and Encryption Binary Encoding Examples Encryption Cipher Examples 1 P a g e Encoding Concepts Binary Encoding Basics
This Unit: Floating Point Arithmetic. CIS 371 Computer Organization and Design. Readings. Floating Point (FP) Numbers
This Unit: Floating Point Arithmetic CIS 371 Computer Organization and Design Unit 7: Floating Point App App App System software Mem CPU I/O Formats Precision and range IEEE 754 standard Operations Addition
Everything you wanted to know about using Hexadecimal and Octal Numbers in Visual Basic 6
Everything you wanted to know about using Hexadecimal and Octal Numbers in Visual Basic 6 Number Systems No course on programming would be complete without a discussion of the Hexadecimal (Hex) number
PREPARATION FOR MATH TESTING at CityLab Academy
PREPARATION FOR MATH TESTING at CityLab Academy compiled by Gloria Vachino, M.S. Refresh your math skills with a MATH REVIEW and find out if you are ready for the math entrance test by taking a PRE-TEST
MACHINE INSTRUCTIONS AND PROGRAMS
CHAPTER 2 MACHINE INSTRUCTIONS AND PROGRAMS CHAPTER OBJECTIVES In this chapter you will learn about: Machine instructions and program execution, including branching and subroutine call and return operations
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
Computers. Hardware. The Central Processing Unit (CPU) CMPT 125: Lecture 1: Understanding the Computer
Computers CMPT 125: Lecture 1: Understanding the Computer Tamara Smyth, [email protected] School of Computing Science, Simon Fraser University January 3, 2009 A computer performs 2 basic functions: 1.
Data Representation. What is a number? Decimal Representation. Interpreting bits to give them meaning. Part 1: Numbers. six seis
Data Representation Interpreting bits to give them meaning Part 1: Numbers Notes for CSC 100 - The Beauty and Joy of Computing The University of North Carolina at Greensboro What is a number? Question:
A single register, called the accumulator, stores the. operand before the operation, and stores the result. Add y # add y from memory to the acc
Other architectures Example. Accumulator-based machines A single register, called the accumulator, stores the operand before the operation, and stores the result after the operation. Load x # into acc
Sheet 7 (Chapter 10)
King Saud University College of Computer and Information Sciences Department of Information Technology CAP240 First semester 1430/1431 Multiple-choice Questions Sheet 7 (Chapter 10) 1. Which error detection
MATH-0910 Review Concepts (Haugen)
Unit 1 Whole Numbers and Fractions MATH-0910 Review Concepts (Haugen) Exam 1 Sections 1.5, 1.6, 1.7, 1.8, 2.1, 2.2, 2.3, 2.4, and 2.5 Dividing Whole Numbers Equivalent ways of expressing division: a b,
We can express this in decimal notation (in contrast to the underline notation we have been using) as follows: 9081 + 900b + 90c = 9001 + 100c + 10b
In this session, we ll learn how to solve problems related to place value. This is one of the fundamental concepts in arithmetic, something every elementary and middle school mathematics teacher should
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
Figure 8-1 Four Possible Results of Adding Two Bits
CHPTER EIGHT Combinational Logic pplications Thus far, our discussion has focused on the theoretical design issues of computer systems. We have not yet addressed any of the actual hardware you might find
Binary Numbering Systems
Binary Numbering Systems April 1997, ver. 1 Application Note 83 Introduction Binary numbering systems are used in virtually all digital systems, including digital signal processing (DSP), networking, and
Recall the process used for adding decimal numbers. 1. Place the numbers to be added in vertical format, aligning the decimal points.
2 MODULE 4. DECIMALS 4a Decimal Arithmetic Adding Decimals Recall the process used for adding decimal numbers. Adding Decimals. To add decimal numbers, proceed as follows: 1. Place the numbers to be added
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
Lecture 4: Binary. CS442: Great Insights in Computer Science Michael L. Littman, Spring 2006. I-Before-E, Continued
Lecture 4: Binary CS442: Great Insights in Computer Science Michael L. Littman, Spring 26 I-Before-E, Continued There are two ideas from last time that I d like to flesh out a bit more. This time, let
Chapter 4 Register Transfer and Microoperations. Section 4.1 Register Transfer Language
Chapter 4 Register Transfer and Microoperations Section 4.1 Register Transfer Language Digital systems are composed of modules that are constructed from digital components, such as registers, decoders,
EE360: Digital Design I Course Syllabus
: Course Syllabus Dr. Mohammad H. Awedh Fall 2008 Course Description This course introduces students to the basic concepts of digital systems, including analysis and design. Both combinational and sequential
JobTestPrep's Numeracy Review Decimals & Percentages
JobTestPrep's Numeracy Review Decimals & Percentages 1 Table of contents What is decimal? 3 Converting fractions to decimals 4 Converting decimals to fractions 6 Percentages 6 Adding and subtracting decimals
NUMBER SYSTEMS APPENDIX D. You will learn about the following in this appendix:
APPENDIX D NUMBER SYSTEMS You will learn about the following in this appendix: The four important number systems in computing binary, octal, decimal, and hexadecimal. A number system converter program
2.3 IPv4 Address Subnetting Part 2
.3 IPv4 Address Subnetting Part Objective Upon completion of this activity, you will be able to determine subnet information for a given IP address and subnetwork mask. When given an IP address, network
International Securities Identification Number (ISIN)
International Securities Identification Number (ISIN) An International Securities Identification Number (ISIN) uniquely identifies a security. An ISIN consists of three parts: Generally, a two letter country
Bachelors of Computer Application Programming Principle & Algorithm (BCA-S102T)
Unit- I Introduction to c Language: C is a general-purpose computer programming language developed between 1969 and 1973 by Dennis Ritchie at the Bell Telephone Laboratories for use with the Unix operating
HFCC Math Lab Arithmetic - 4. Addition, Subtraction, Multiplication and Division of Mixed Numbers
HFCC Math Lab Arithmetic - Addition, Subtraction, Multiplication and Division of Mixed Numbers Part I: Addition and Subtraction of Mixed Numbers There are two ways of adding and subtracting mixed numbers.
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
BCD (ASCII) Arithmetic. Where and Why is BCD used? Packed BCD, ASCII, Unpacked BCD. BCD Adjustment Instructions AAA. Example
BCD (ASCII) Arithmetic We will first look at unpacked BCD which means strings that look like '4567'. Bytes then look like 34h 35h 36h 37h OR: 04h 05h 06h 07h x86 processors also have instructions for packed
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
Decimal to Binary Conversion
Decimal to Binary Conversion A tool that makes the conversion of decimal values to binary values simple is the following table. The first row is created by counting right to left from one to eight, for
Paramedic Program Pre-Admission Mathematics Test Study Guide
Paramedic Program Pre-Admission Mathematics Test Study Guide 05/13 1 Table of Contents Page 1 Page 2 Page 3 Page 4 Page 5 Page 6 Page 7 Page 8 Page 9 Page 10 Page 11 Page 12 Page 13 Page 14 Page 15 Page
Lab 1: Full Adder 0.0
Lab 1: Full Adder 0.0 Introduction In this lab you will design a simple digital circuit called a full adder. You will then use logic gates to draw a schematic for the circuit. Finally, you will verify
Logic Reference Guide
Logic eference Guide Advanced Micro evices INTOUCTION Throughout this data book and design guide we have assumed that you have a good working knowledge of logic. Unfortunately, there always comes a time
Unit 1 Number Sense. In this unit, students will study repeating decimals, percents, fractions, decimals, and proportions.
Unit 1 Number Sense In this unit, students will study repeating decimals, percents, fractions, decimals, and proportions. BLM Three Types of Percent Problems (p L-34) is a summary BLM for the material
