DEPARTMENT OF ELECTRICAL AND COMPUTER ENGINEERING, THE UNIVERSITY OF NEW MEXICO ECE-238L: Computer Logic Design Fall 2013.

Size: px
Start display at page:

Download "DEPARTMENT OF ELECTRICAL AND COMPUTER ENGINEERING, THE UNIVERSITY OF NEW MEXICO ECE-238L: Computer Logic Design Fall 2013."

Transcription

1 ECE-8L: Computer Logic Design Fall Notes - Chapter BINARY NUMBER CONVERSIONS DECIMAL NUMBER SYSTEM A decimal digit can take values from to 9: Digit-b-digit representation of a positive integer number (powers of ): DIGIT Number: 97 hundreds thousands tens units thousands, hundreds, 7 tens, and units 97 = Positional Number Representation Let s consider the numbers from to 999. We represent these numbers with digits (each digit being a number between and 9). We show a -digit number using the positional number representation: MATHEMATICAL REPRESENTATION -digit d d d EXAMPLE 9 Third Digit Second Digit First Digit The positional number representation allows us to epress the decimal value using powers of ten: D = d + d + d. Eample: Decimal Number Eercise: Write down the -digit and the powers of ten representations for the following numbers: Decimal Number -digit representation d + d + d digit representation d d d Third Digit Second Digit First Digit Powers of : d + d + d

2 ECE-8L: Computer Logic Design Fall General Case: Positional number representation for an integer positive number with n digits: Decimal Value: d n- n- + d n- n d + d Eample: 984 (7 digits) (6 digits) Maimum value: The table presents the maimum attainable value for a given number of digits. What pattern do ou find? Can ou complete it for the highlighted cases (4 and 6)? Number of digits Maimum value Range 9 = = = = n = n n - Maimum value for a number with n digits: Based on the table, the maimum decimal value for a number with n digits is given b: With n digits, we can represent positive integer numbers from to n -. d n- d n-... d d D = = 9 n- + 9 n = n - n digits With 7 digits, what is the range (starting from ) of positive numbers that we can represent? How man different numbers can we represent? BINARY NUMBER SYSTEM DIGIT BIT We are used to the decimal number sstem. However, there eist other number sstems: octal, headecimal, vigesimal, binar, etc. In particular, binar numbers are ver practical as the are used b digital computers. For binar numbers, the counterpart of digit (that can take values from to 9) is the bit (binar digit) that can take the value of or. Bit: Unit of information that a computer uses to process and retrieve data. It can also be used as a logical variable (see Chapter ). Binar representation: We use the positional number representation. Note that here, we are using a string of bits to represent a binar number. Converting a binar number into a decimal number: The following figure depicts two cases: -bit numbers and -bit numbers. Note that the positional representation with powers of two let us obtain the decimal value (integer positive) of the binar number.

3 ECE-8L: Computer Logic Design Fall MATHEMATICAL REPRESENTATION -bit Second Bit b b First Bit Binar number b b Powers of : b + b Decimal Number MATHEMATICAL REPRESENTATION -bit b b b Third Bit Second Bit First Bit Binar number Powers of : Decimal Number b b b b + b + b General case: Positional number representation for a binar number with n bits: Most significant (leftmost) bit b n- b n-... b b Least significant (rightmost) bit This formula converts a binar number into a decimal number: Decimal Value (integer positive): To avoid confusion, we usuall write a binar number and attach a suffi : (b n b n b b ) Eample: 6 bits: () D = = 4 4 bits: () D = = Maimum value for a given number of bits. Complete the tables for the highlighted cases (4 and 6): Number of bits Maimum value Range D = b n- n- + b n- n b + b n n - n - Maimum value for n bits: The maimum decimal value with n bits is given b: D =... = n- + n = n - n bits With n bits, we can represent positive integer numbers from to n -. ( n numbers)

4 ECE-8L: Computer Logic Design Fall The case n=8 bits is of particular interest, as a string of 8 bits is called a bte. Here, the range for 8-bit numbers is to 8 - to 55. b 7 b 6 b 5 b 4 b b b b Most significant (leftmost) bit Least significant (rightmost) bit The table shows some eamples: Decimal Number bit format b 7 b 6 b 5 b 4 b b d d b b b b b + b + b + b Eercise: Convert the following binar numbers (positive integers) to their decimal values: 8-bit representation b b b b b + b + b + b Decimal Number In general to convert a number of base 'r' (r =,,4, ) to decimal, we use the following formula: base 'r': (r n r n r r ) r Conversion to decimal: D = r n r n + r n r n + + r r + r r Also, the maimum decimal value for a number in base 'r' with 'n' digits is: D = rrr rrr = r r n + r n r n + + r r + r r = r n Eample: Base-8: Number of digits Maimum value Range n n n - Eamples: (56) 8 : base 8 (octal sstem) Number of digits: n = 5 Conversion to decimal: D = = 89 () 4 : base 4 (quaternar sstem) Number of digits: n = 4 Conversion to decimal: D = =

5 ECE-8L: Computer Logic Design Fall CONVERSION OF DECIMAL TO BINARY NUMBERS Two eamples are shown: base base base base 5???????? 6 5 Remainder 6 Remainder stop here! stop here! Note that some numbers require fewer bits than others. If we want to use a specific bit representation, e.g., 8-bit, we just need to append eros to the left until the 8 bits are completed. For eample: (8-bit number) (8-bit number) Actuall, ou can use this method to convert a decimal number into an other base. For eample, if ou want to convert it into a base-8 number, just divide b 8 and group the remainders. Eample: Converting a decimal number to base-8: base Remainder base 8???? stop here!

6 ECE-8L: Computer Logic Design Fall Eercise: Convert the following two decimal numbers to binar numbers. Fill in the blanks in the figure below. base base base base 6???? 97???? Remainder Remainder 6 97 Now, convert the following decimal numbers to binar numbers. The final binar number must have 8 bits (append eros to the left to complete). Decimal number 4 Binar number with 8 bits. b 7b 6b 5b 4b b b b

7 ECE-8L: Computer Logic Design Fall HEXADECIMAL NUMBERS In the decimal number sstem, a digit can take a value from to 9. In the headecimal number sstem, a headecimal digit can take a value from to 5. However, as to avoid confusion, the numbers from to 5 are represented b letters (A-F): HEXADECIMAL DIGIT Decimal value: A single headecimal digit is also called a nibble. The following figure shows a -digit headecimal number. Note that the positional representation with powers of 6 let us obtain the decimal value (integer positive) of the headecimal number. This is the same as converting a headecimal number into a decimal number. MATHEMATICAL REPRESENTATION -headecimal digits Second Digit Note that when we use the letters A-F in the multiplications inside the powers of 6 representation (e.g., A ), we need to replace the headecimal smbol b its decimal value. A =, B =, C =, D =, E = 4, F = 5 For eample: A 6 () 6. EXERCISE: Convert the following headecimal numbers (positive integers) to their decimal values: -he. digit representation h 6 +h 6 Decimal Number AB CE 5 7 F E9 h h A B C D E F First Digit He. number h h 5A 8 FB E A7 Powers of 6: h 6 + h A F 6 + B E 6 A Decimal Value General case: Positional number representation for a headecimal number with n nibbles (headecimal digits): Most significant (leftmost) nibble h n- h n-... h h Least significant (rightmost) nibble

8 ECE-8L: Computer Logic Design Fall To convert a headecimal number into a decimal, we appl the following formula: Decimal Value (integer positive): D = h n- 6 n- + h n- 6 n h 6 + h 6 To avoid confusion, it is sometimes customar to append the prefi to a headecimal number: Eamples: FDA9: FDA9 F D A B87C: B87C B C 6 The table presents the maimum attainable value for the given number of nibbles (headecimal digits). What pattern do ou find? Can ou complete it for the highlighted cases (4 and 6)? Number of bits Maimum value Range F 6 - F 6 - FF 6 - FF 6 - FFF 6 - FFF FFFFF h n- h n-...h h n FFF FFF 6 n - FFF FFF 6 n - Maimum value for n nibbles: The maimum decimal value with n nibbles is given b: D = FFF...FFF = F 6 n- + F 6 n F 6 + F n n = 6 n - n nibbles With n nibbles, we can represent positive integer numbers from to 6 n -. (6 n numbers) Btes, KB (Kilobtes), MB (Megabtes), GB (Gigabtes), TB (Terabtes) Nibble Bte KB MB GB TB 4 bits 8 bits btes 6 btes 9 btes btes Note that the nibble (4 bits) is one headecimal digit. Also, one bte (8 bits) is represented b two headecimal digits. RELATIONSHIP BETWEEN HEXADECIMAL AND BINARY NUMBERS Conversions between headecimal and binar sstems are ver common when dealing with digital computers. In this activit, we will learn how these sstems are related and how eas it is to convert between one and the other. Headecimal to binar: We alread know how to convert a headecimal number into a decimal number. We can then can convert the decimal number into a binar number (using successive divisions). Binar to headecimal: We can first convert the binar number to a decimal number. Then, using an algorithm similar to the one that converts decimals into binar, we can convert our decimal number into a headecimal number.

9 ECE-8L: Computer Logic Design Fall SIMPLE METHOD TO CONVERT HEXADECIMAL TO BINARY NUMBERS AND VICEVERSA The previous two conversion processes are too tedious. Fortunatel, headecimal numbers have an interesting propert that allows quick conversion of binar numbers to headecimals and viceversa. Binar to headecimal: We group the binar numbers in groups of 4 (starting from the rightmost bit). If the last group of bits does not have four bits, we complete with eros to the left. Then, we independentl convert each group of 4 bits to its decimal value. Notice that 4 bits can onl take decimal values between and 4 - to 5, hence 4 bits represent onl one headecimal digit. In other words, for each group of 4 bits, there are onl 6 possible headecimal digits to pick from. The figure below shows an eample. Binar: decimal: headecimal: Then: Verification: = 5D 5 5 D = = 9 5D = D 6 = 9 binar dec he A B C D 4 E 5 F Eercise: Group the following binar numbers in groups of 4 bits and obtain the headecimal representation. Use the table in the previous figure to pick the correspondent headecimal digit for each group of 4 bits. Binar number Headecimal number Headecimal to binar: It is basicall the inverse of the process of converting a binar into a headecimal numbers. We pick each headecimal digit and convert it (using alwas 4 bits) to its 4- bit binar representation. The binar number is the concatenation of all resulting group of 4 bits. C = C = DO NOT discard these eros when concatening!

10 ECE-8L: Computer Logic Design Fall Eercise: Convert these headecimal numbers to binar. Verif it b converting both the binar and headecimal number (the should match). Headecimal number A 89 4 A CE Binar number Decimal value The reason headecimal numbers are popular is because headecimal numbers provide a short-hand notation for binar numbers. Another common number sstem is computers is base-8 (octal). The conversion between base-8 and base- resembles that of converting between base-6 and base-. Here, we group the binar numbers in groups of bits: BINARY TO OCTAL Binar: octal: 5 Then: = 5 8 binar dec oct Verification: = = = = 9 OCTAL TO BINARY = 8 = DO NOT discard these eros when concatening!

11 ECE-8L: Computer Logic Design Fall INTRODUCTION TO FIXED-POINT ARITHMETIC We have been representing positive integer numbers. But what if we wanted to represent numbers with fractional parts? Fied-point arithmetic: Binar representation of positive decimal numbers with fractional parts. Given the following binar number: (b n b n b b. b b ) Formula to convert it to decimal: D = b n n + b n n + + b + b + b + b + Eample: (.) = To convert it to headecimal (or octal): Binar:.. octal: 5. 6 Binar:.. Now, what if we have a decimal number with fractional part? What we do is we divide the integer part and the fractional part. We obtain the binar representation of the integer part using what we know. As for the fractional part, what we do is successive multiplications b, the integer parts resulting are the results. Eample: headecimal: 5. A 8 base.65 MSB.65 =.5 = +.5 base???? base.7 MSB.7 =.4 = +.4 base????.5 =.5 = = = +.4 =.8 = =.6 = +.6. stop here!.6 =. = +.. =.4 = =.8 =

12 ECE-8L: Computer Logic Design Fall BINARY CODES: We know that with n bits, we can represent n numbers, from to n. However, with n bits, we can also represent n numbers in an range. Moreover, with n bits we can represent n different smbols. Eample: 7-bit US-ASCII character-encoding scheme. Each character is represented b 7 bits. Thus, the number of characters that can be represented is given b 7 = 8.Each character is said to have a binar code. Eample: 4-bit color. Each color is represented b 4 bits, providing 4 distinct color. Each color is said to have a binar code. In general, we might have N smbols to represent. In this case, the number of bits needed to represent N smbols is given b log N. Eample: N = 5 smbols. With bits, onl 4 smbols can be represented. With bits, 8 smbols can be represented. Thus, the number of bits required is n = = log 5 = log 8. Note that 8 is the power of closest to N=5 and that is greater than or equal to 5. Eample: Unicode can represent more than, characters and attempts to cover all world s scripts. A common character encoding is UTF-6, which uses two pairs of 6-bit units. For most purposes, a 6- bit unit suffices (covering 6 = 6556) characters. : C : A9

13 EMITTER RECEPTOR DEPARTMENT OF ELECTRICAL AND COMPUTER ENGINEERING, THE UNIVERSITY OF NEW MEXICO ECE-8L: Computer Logic Design Fall BCD CODE: Here, we represent decimal numbers b independentl encoding each digit in binar form. Each digit requires 4 bits. Notice that the binar numbers ( ) to (5) are not used. Onl out of 6 values are used to encode ever decimal digit. This is a ver useful code for inputting devices (e.g. kepad). However, for implementing arithmetic operations, the binar number representation is more efficient. Also note that 6 values are wasted. The BCD code is not the same as the binar number!!! Eample: 58 This decimal number can be represented as a binar number: Using the BCD code, the binar representation would be: BCD decimal # There eist man other binar codes (e.g., reflective gra code, 6--- code, -out-of-5 code) to represent decimal numbers. Usuall, each of them is tailored to an specific application. REFLECTIVE GRAY CODE: g g Decimal Number b b b How to convert from RGC to binar and binar to RGC? g g g g g g g Application Measuring angular position with 4-bit RGC. 4 beams are emitted along an ais. When a light beam passes (transparent spots, represented as whites), we get a logical, otherwise. The RGC encoding makes that between areas onl one bit changes, thereb reducing the possibilit of a bad reading (especiall when the beam between adjacent areas. Eample: From to : Onl one bit flips. If we used to, two bits would flip. This is prone to more errors, especiall when the beams are close to the line where the two areas meet Angle g g g g

14 ECE-8L: Computer Logic Design Fall PRACTICE EXERCISES. Convert the following binar numbers to i) decimal, ii) octal, and iii) headecimal.... Represent the following decimal numbers in the binar sstem: 4,5,5,,,64,8,, 9,.5,.47,.. What is the minimum number of bits required to represent the following decimal numbers: 7, 56, 4, 6, 7, 49, 5,.65, 55.5,.5 4. We want to represent, different colors. What is the minimum number of bits required to represent those colors? 5. Represent the following decimal numbers in i) binar, ii) BCD, iii) and Reflective Gra Code Convert the following binar numbers into its correspondent Reflective Gra Code representation. 7. Convert the following binar strings coded with Reflective Gra Code into the binar number sstem: 8. We have numpads. To open a lock, one must press the correct number on each one (e.g. 9 and ). BCD encoding is ver useful here, because each decimal number is represented with 4 bits and we can quickl create a circuit that opens the lock. If we wanted to use the binar representation of the decimal with digits, we would need to read the 8 lines, convert those 8 bits to the binar representation (a non-trivial task) and then perform the comparison.?

15 ECE-8L: Computer Logic Design Fall KARNAUGH MAPS: variables: f m m m m m m m m f f = ' + ' = m +m f f = ' + variables: f m m m m m 4 m 5 m 6 m 7 m m m 6 m 4 m m m 7 m 5 f f = '' + '' + f = ' + ' f = ' + '

16 ECE-8L: Computer Logic Design Fall 4 variables: w f m m m m m 4 m 5 m 6 m 7 m 8 m 9 m m m m m 4 m 5 w m m 4 m m 5 m m 7 m m 6 m m m 5 m 4 m 8 m 9 m m w w w w w w w w f = 'w' + w w w w w w w w w f w w w w w w w w f = ''w' + 'w + ''w w f = ' + w' w w w w w w w

17 sign and magnitude 's complement 's complement DEPARTMENT OF ELECTRICAL AND COMPUTER ENGINEERING, THE UNIVERSITY OF NEW MEXICO ECE-8L: Computer Logic Design Fall REPRESENTATION OF SIGNED NUMBERS: Signed number: MSB alwas represents the sign. : negative, : positive. Representations: Sign-and-magnitude, 's complement, 's complement 's COMPLEMENT: For a number B = b n b b, the 's complement of B is given b a number K = k n k k. K represents '-B'. where K = ( n ) B, n = # of bits (including sign bit) ( n ): largest unsigned number with n bits. n n n k i i = ( n ) b i i (k i b i ) i = n k i + b i =, i k i = b i i= i= i= Eample: B = = 9 (positive number in 's complement) To get '-9' in 's complement representation, we just invert each bit of B: K = = 9 (negative number is 's complement) * Notice that K = ( n ) B is valid onl when we think of K and B as unsigned numbers. K = = = ( 5 ) 9 Eample: B = (negative number in 's complement) Remember: If the MSB is '', the number is negative. What number does it represent? We get the positive number first. K = = 5 Thus, B = -5. The 's complement representation allows us to represent both positive and negative numbers. Note that to obtain the 's complement of a number, ou need to invert the bits. Also, the 's complement of a number can be either a positive or negative number. With n bits, we can represent n numbers from n + to n. When using the 's complement representation, it is mandator to specif how man bits we are using. 's COMPLEMENT: For a number B = b n b b, the 's complement of B is given b a number K = k n k k. K represents '-B'. where K = n B, n = # of bits (including sign bit) K = n B = ( n ) B + b b b b Then, to get the 's complement: first get the 's complement and then add. Or in other words, first invert all the bits and then add. Eample: B = = 9 (positive number in 's complement) To get '-9' in 's complement representation, we invert each bit of B and add : K = = 9 (negative number is 's complement) * K = n B is valid onl if we think of K and B as unsigned numbers. K = = = 5 9

18 ECE-8L: Computer Logic Design Fall Eample: B = (negative number in 's complement) Remember: If the MSB is '', the number is negative. What number does it represent? We get the positive number first. K = = 6 Thus, B = -6. With n bits, we can represent n numbers from n to n. When using the 's complement representation, it is mandator to specif how man bits we are using Formula to get the decimal value of a number in 's complement representation: If the number B is positive, we know that the MSB is, b n =. n B = b i i = b n n + b i i = b i i i= n i= n i= If the number B is negative, we know that the MSB is, b n =. If we take the 's complement of B, we get K. The number K represents -B. The number K is positive. K = n B is valid if we think of K and B as unsigned numbers: n k i i = n b i i i= n i= We want a formula that involves b i and that provides the decimal number -K. n (a) K = k i i = b i i n = b n n + b i i n i= n i= n n K = b n n + b i i n = n (b n ) + b i i i= n i= i= n n B = K = n ( ) + b i i = n + b i i (b) Using (a) and (b), the formula for the decimal value of B (either positive or negative) is: Eamples: = = = 4 + = 8 B = b n n + b i i Sign-etension in 's complement representation: In man circumstances, we might want to represent numbers in 's complement with a fied number of bits. For eample, the following two numbers require a minimum of 5 bits: = = 9 = = +5 What if we wanted to use 8 bits to represent them? The 's complement representation allows us to signetend: If the number is positive, we attach eros to the left. If the number is negative, we attach ones to the left. In the eample, note how we added three bits to the left in each case: = = 9 = = +5 n i= i= i=

19 ECE-8L: Computer Logic Design Fall ARITHMETIC OPERATIONS UNSIGNED NUMBERS - ADDITION Addition of bits: c s carr sum c s s c HA s c Addition of 5 bits: 5: + : 5: c o s 4 s s s s c o c i + s c i s c o carr sum HA s c s c o There are inputs. Building the truth table is not practical! Instead we build a cascade of Full Adders. General case: 'n' bits: n- n- c out c n c n- c c c c c... in = s n- s s s Full adder design: c i i i c i+ s i i i c i i i c i s i = i i c i + i i c i + i i c i + i i c i s i s i = ( i i )c i + ( i i )c i = i i c i c i+ = i i + i c i + i c i

20 ECE-8L: Computer Logic Design Fall Overflow: Suppose we have onl 4 bits to represent binar numbers: + + cout= cout= OVERFLOW!!! Overflow occurs when an arithmetic operation require more bits than the bits we are using to represent our numbers. For 4 bits, the range is to 5. If the summation is greater than 5, then there is overflow. For n bits, overflow occurs when the summation is greater than n. To detect overflow: For unsigned numbers, the overflow bit is the same as the output cout. To avoid overflow when adding, a common technique is to sign-etend the two summands. For eample, if the two summands are 4-bits wide, then we add one more bit. So, we use 5 bits to represent our numbers. In the case of unsigned numbers, sign-etend amounts to ero-etend. Note that in general, if the two summands are n-bits wide, the result will have at most n+ bits. cout= + SIGNED NUMBERS ('s COMPLEMENT) - ADDITION +5 = + + = -5 = + + = +5 = + - = -5 = + - = +7 = cout= - = cout= + = -7 = cout= cout= There is no overflow here, we just ignore the cout bit We can use the same circuitr that we used for unsigned numbers. That's the great advantage of the 's complement representation. c out c 4 c c c c c in = s s Overflow: For 4 bits, the range that we represent is to. Overflow occurs when the summation falls outside this range. s s cout = c 4 +7 = + + = -7 = + + = +7 = + - = -7 = + - = +9 = -5 = +5 = -9 = c 4 =, c = c 4 =, c = c 4 =, c = c 4 =, c = If c 4 c, there is overflow. If c 4 = c, No overflow and we ignore c 4. Overflow = c 4 c

21 ECE-8L: Computer Logic Design Fall For n bits, the range is n to n. Overflow occurs when the summation falls outside this range. Overflow = c n c n Circuit for n =4: overflow c out c 4 c c c c c in = To avoid overflow when adding, a common technique is to sign-etend the two summands. For eample, if the two summands are 4-bits wide, then we add one more bit. So, we use 5 bits to represent our numbers. Note that in general, if the two summands are n-bits wide, the result will have at most n+ bits. Important: If there is no overflow, ou MUST discard the carr out, and onl use the 'n' bits. s s s cout = c 5 +7 = + -7 = + + = - = +9 = c 5 =, c 4 = s -9 = c 5 =, c 4 = SUBTRACTION: X - Y = X + (-Y). In this case, we onl need to create the 's complement of Y (the subtrahend). The circuit is basicall the same as the adder. We just need to include a circuit that creates the 's complement of Y: 7 - = 7 + (-): += -> -= cout = c 4 +7 = + - = +4 = c 4 =, c = overflow c out c 4 c c c c c in = s s s Adder/Subtractor Unit for 's complement numbers: s add/sub add = sub = overflow c out c 4 c c c c c in s s s s add/sub i f add/sub i f

22 ECE-8L: Computer Logic Design Fall PRACTICE EXERCISES. Complete the following table. Use the fewest number of bits for ever case. Decimal Sign-and-magnitude 's complement 's complement Perform the following operations in 's complement. Use the fewest number of bits for the operation, sign-etend when needed Convert the following numbers to its 's complement representation. But ou need to use 6 bits to represent each number We want to perform the following addition/subtraction operations. We are using the 's complement representation. However, we are restricted to use onl bits. Determine whether there is overflow when performing these operations onl using the decimal numbers We want to perform the following operation using the 's complement representation. First, determine the number of bits that we require to represent the two summands. Then determine whether there is overflow b performing the operation in 's complement. Get c n, c n- (carries) on each case The following is the formula to get the decimal value that a number in 's complement represents. B = b n n + b i i i= Derive a formula to get the decimal value that a number in 's complement represents. n

ELECTRICAL AND COMPUTER ENGINEERING DEPARTMENT, OAKLAND UNIVERSITY ECE-2700: Digital Logic Design Winter Notes - Unit 4. hundreds.

ELECTRICAL AND COMPUTER ENGINEERING DEPARTMENT, OAKLAND UNIVERSITY ECE-2700: Digital Logic Design Winter Notes - Unit 4. hundreds. UNSIGNED INTEGER NUMBERS Notes - Unit 4 DECIMAL NUMBER SYSTEM A decimal digit can take values from to 9: Digit-by-digit representation of a positive integer number (powers of ): DIGIT 3 4 5 6 7 8 9 Number:

More information

ELECTRICAL AND COMPUTER ENGINEERING DEPARTMENT, OAKLAND UNIVERSITY ECE-278: Digital Logic Design Fall Notes - Unit 4. hundreds.

ELECTRICAL AND COMPUTER ENGINEERING DEPARTMENT, OAKLAND UNIVERSITY ECE-278: Digital Logic Design Fall Notes - Unit 4. hundreds. ECE-78: Digital Logic Design Fall 6 UNSIGNED INTEGER NUMBERS Notes - Unit 4 DECIMAL NUMBER SYSTEM A decimal digit can take values from to 9: Digit-by-digit representation of a positive integer number (powers

More information

Solutions - Homework 2 (Due date: February 5 5:30 pm) Presentation and clarity are very important! Show your procedure!

Solutions - Homework 2 (Due date: February 5 5:30 pm) Presentation and clarity are very important! Show your procedure! Solutions - Homework (Due date: Februar 5 th @ 5: pm) Presentation and clarit are ver important! Show our procedure! PROBLEM ( PTS) In these problems, ou MUST show our conversion procedure. a) Convert

More information

Number System. Introduction. Decimal Numbers

Number System. Introduction. Decimal Numbers Number System Introduction Number systems provide the basis for all operations in information processing systems. In a number system the information is divided into a group of symbols; for example, 26

More information

BINARY SYSTEM. Binary system is used in digital systems because it is:

BINARY SYSTEM. Binary system is used in digital systems because it is: CHAPTER 2 CHAPTER CONTENTS 2.1 Binary System 2.2 Binary Arithmetic Operation 2.3 Signed & Unsigned Numbers 2.4 Arithmetic Operations of Signed Numbers 2.5 Hexadecimal Number System 2.6 Octal Number System

More information

Solutions - Homework 2 (Due date: October 9:30 am) Presentation and clarity are very important!

Solutions - Homework 2 (Due date: October 9:30 am) Presentation and clarity are very important! ECE-8L: Computer Logic Design Fall Solutions - Homework (Due date: October rd @ 9: am) Presentation and clarit are ver important! PROBLEM ( PTS) Complete the following table. Use the fewest number of bits

More information

Digital Fundamentals

Digital Fundamentals Digital Fundamentals Tenth Edition Floyd Chapter 2 2009 Pearson Education, Upper 2008 Pearson Saddle River, Education NJ 07458. All Rights Reserved Decimal Numbers The position of each digit in a weighted

More information

A complement number system is used to represent positive and negative integers. A complement number system is based on a fixed length representation

A complement number system is used to represent positive and negative integers. A complement number system is based on a fixed length representation Complement Number Systems A complement number system is used to represent positive and negative integers A complement number system is based on a fixed length representation of numbers Pretend that integers

More information

Decimal & Binary Representation Systems. Decimal & Binary Representation Systems

Decimal & Binary Representation Systems. Decimal & Binary Representation Systems Decimal & Binary Representation Systems Decimal & binary are positional representation systems each position has a value: d*base i for example: 321 10 = 3*10 2 + 2*10 1 + 1*10 0 for example: 101000001

More information

Binary Codes. Dr. Mudathir A. Fagiri

Binary Codes. Dr. Mudathir A. Fagiri Binary Codes Dr. Mudathir A. Fagiri Binary System The following are some of the technical terms used in binary system: Bit: It is the smallest unit of information used in a computer system. It can either

More information

ECE 2020B Fundamentals of Digital Design Spring problems, 6 pages Exam Two Solutions 26 February 2014

ECE 2020B Fundamentals of Digital Design Spring problems, 6 pages Exam Two Solutions 26 February 2014 Problem 1 (4 parts, 21 points) Encoders and Pass Gates Part A (8 points) Suppose the circuit below has the following input priority: I 1 > I 3 > I 0 > I 2. Complete the truth table by filling in the input

More information

CS & IT Conversions. Magnitude 10,000 1,

CS & IT Conversions. Magnitude 10,000 1, CS & IT Conversions There are several number systems that you will use when working with computers. These include decimal, binary, octal, and hexadecimal. Knowing how to convert between these number systems

More information

DIGITAL SYSTEM DESIGN

DIGITAL SYSTEM DESIGN DIGITAL SYSTEM DESIGN UNIT I: Introduction to Number Systems and Boolean Algebra Digital and Analog Basic Concepts, Some history of Digital Systems-Introduction to number systems, Binary numbers, Number

More information

Chapter 1 Review of Number Systems

Chapter 1 Review of Number Systems 1.1 Introduction Chapter 1 Review of Number Systems Before the inception of digital computers, the only number system that was in common use is the decimal number system which has a total of 10 digits

More information

CHW 261: Logic Design

CHW 261: Logic Design CHW 261: Logic Design Instructors: Prof. Hala Zayed Dr. Ahmed Shalaby http://www.bu.edu.eg/staff/halazayed14 http://bu.edu.eg/staff/ahmedshalaby14# Slide 1 Slide 2 Slide 3 Digital Fundamentals CHAPTER

More information

MACHINE LEVEL REPRESENTATION OF DATA

MACHINE LEVEL REPRESENTATION OF DATA MACHINE LEVEL REPRESENTATION OF DATA CHAPTER 2 1 Objectives Understand how integers and fractional numbers are represented in binary Explore the relationship between decimal number system and number systems

More information

Number Systems Base r

Number Systems Base r King Fahd University of Petroleum & Minerals Computer Engineering Dept COE 2 Fundamentals of Computer Engineering Term 22 Dr. Ashraf S. Hasan Mahmoud Rm 22-44 Ext. 724 Email: ashraf@ccse.kfupm.edu.sa 3/7/23

More information

Slide Set 1. for ENEL 339 Fall 2014 Lecture Section 02. Steve Norman, PhD, PEng

Slide Set 1. for ENEL 339 Fall 2014 Lecture Section 02. Steve Norman, PhD, PEng Slide Set 1 for ENEL 339 Fall 2014 Lecture Section 02 Steve Norman, PhD, PEng Electrical & Computer Engineering Schulich School of Engineering University of Calgary Fall Term, 2014 ENEL 353 F14 Section

More information

Chapter 2: Number Systems

Chapter 2: Number Systems Chapter 2: Number Systems Logic circuits are used to generate and transmit 1s and 0s to compute and convey information. This two-valued number system is called binary. As presented earlier, there are many

More information

Binary Addition. Add the binary numbers and and show the equivalent decimal addition.

Binary Addition. Add the binary numbers and and show the equivalent decimal addition. Binary Addition The rules for binary addition are 0 + 0 = 0 Sum = 0, carry = 0 0 + 1 = 0 Sum = 1, carry = 0 1 + 0 = 0 Sum = 1, carry = 0 1 + 1 = 10 Sum = 0, carry = 1 When an input carry = 1 due to a previous

More information

ECE 2020B Fundamentals of Digital Design Spring problems, 6 pages Exam Two 26 February 2014

ECE 2020B Fundamentals of Digital Design Spring problems, 6 pages Exam Two 26 February 2014 Instructions: This is a closed book, closed note exam. Calculators are not permitted. If you have a question, raise your hand and I will come to you. Please work the exam in pencil and do not separate

More information

Number Systems CHAPTER Positional Number Systems

Number Systems CHAPTER Positional Number Systems CHAPTER 2 Number Systems Inside computers, information is encoded as patterns of bits because it is easy to construct electronic circuits that exhibit the two alternative states, 0 and 1. The meaning of

More information

Chapter 2. Positional number systems. 2.1 Signed number representations Signed magnitude

Chapter 2. Positional number systems. 2.1 Signed number representations Signed magnitude Chapter 2 Positional number systems A positional number system represents numeric values as sequences of one or more digits. Each digit in the representation is weighted according to its position in the

More information

Logic Circuits I ECE 1411 Thursday 4:45pm-7:20pm. Nathan Pihlstrom.

Logic Circuits I ECE 1411 Thursday 4:45pm-7:20pm. Nathan Pihlstrom. Logic Circuits I ECE 1411 Thursday 4:45pm-7:20pm Nathan Pihlstrom www.uccs.edu/~npihlstr My Background B.S.E.E. from Colorado State University M.S.E.E. from Colorado State University M.B.A. from UCCS Ford

More information

Digital Arithmetic. Digital Arithmetic: Operations and Circuits Dr. Farahmand

Digital Arithmetic. Digital Arithmetic: Operations and Circuits Dr. Farahmand Digital Arithmetic Digital Arithmetic: Operations and Circuits Dr. Farahmand Binary Arithmetic Digital circuits are frequently used for arithmetic operations Fundamental arithmetic operations on binary

More information

Basic Definition INTEGER DATA. Unsigned Binary and Binary-Coded Decimal. BCD: Binary-Coded Decimal

Basic Definition INTEGER DATA. Unsigned Binary and Binary-Coded Decimal. BCD: Binary-Coded Decimal Basic Definition REPRESENTING INTEGER DATA Englander Ch. 4 An integer is a number which has no fractional part. Examples: -2022-213 0 1 514 323434565232 Unsigned and -Coded Decimal BCD: -Coded Decimal

More information

Computer Organization

Computer Organization Computer Organization Register Transfer Logic Number System Department of Computer Science Missouri University of Science & Technology hurson@mst.edu 1 Decimal Numbers: Base 10 Digits: 0, 1, 2, 3, 4, 5,

More information

Lecture 2: Number Systems

Lecture 2: Number Systems Lecture 2: Number Systems Syed M. Mahmud, Ph.D ECE Department Wayne State University Original Source: Prof. Russell Tessier of University of Massachusetts Aby George of Wayne State University Contents

More information

Chapter 1. Digital Systems and Binary Numbers

Chapter 1. Digital Systems and Binary Numbers Chapter 1. Digital Systems and Binary Numbers Tong In Oh 1 1.1 Digital Systems Digital age Characteristic of digital system Generality and flexibility Represent and manipulate discrete elements of information

More information

Digital Logic. The Binary System is a way of writing numbers using only the digits 0 and 1. This is the method used by the (digital) computer.

Digital Logic. The Binary System is a way of writing numbers using only the digits 0 and 1. This is the method used by the (digital) computer. Digital Logic 1 Data Representations 1.1 The Binary System The Binary System is a way of writing numbers using only the digits 0 and 1. This is the method used by the (digital) computer. The system we

More information

10.1. Unit 10. Signed Representation Systems Binary Arithmetic

10.1. Unit 10. Signed Representation Systems Binary Arithmetic 0. Unit 0 Signed Representation Systems Binary Arithmetic 0.2 BINARY REPRESENTATION SYSTEMS REVIEW 0.3 Interpreting Binary Strings Given a string of s and 0 s, you need to know the representation system

More information

DIGITAL SYSTEM FUNDAMENTALS (ECE 421) DIGITAL ELECTRONICS FUNDAMENTAL (ECE 422) COURSE / CODE NUMBER SYSTEM

DIGITAL SYSTEM FUNDAMENTALS (ECE 421) DIGITAL ELECTRONICS FUNDAMENTAL (ECE 422) COURSE / CODE NUMBER SYSTEM COURSE / CODE DIGITAL SYSTEM FUNDAMENTALS (ECE 421) DIGITAL ELECTRONICS FUNDAMENTAL (ECE 422) NUMBER SYSTEM A considerable subset of digital systems deals with arithmetic operations. To understand the

More information

Chapter 2. Data Representation in Computer Systems

Chapter 2. Data Representation in Computer Systems Chapter 2 Data Representation in Computer Systems Chapter 2 Objectives Understand the fundamentals of numerical data representation and manipulation in digital computers. Master the skill of converting

More information

1010 2?= ?= CS 64 Lecture 2 Data Representation. Decimal Numbers: Base 10. Reading: FLD Digits: 0, 1, 2, 3, 4, 5, 6, 7, 8, 9

1010 2?= ?= CS 64 Lecture 2 Data Representation. Decimal Numbers: Base 10. Reading: FLD Digits: 0, 1, 2, 3, 4, 5, 6, 7, 8, 9 CS 64 Lecture 2 Data Representation Reading: FLD 1.2-1.4 Decimal Numbers: Base 10 Digits: 0, 1, 2, 3, 4, 5, 6, 7, 8, 9 Example: 3271 = (3x10 3 ) + (2x10 2 ) + (7x10 1 ) + (1x10 0 ) 1010 10?= 1010 2?= 1

More information

IT 1204 Section 2.0. Data Representation and Arithmetic. 2009, University of Colombo School of Computing 1

IT 1204 Section 2.0. Data Representation and Arithmetic. 2009, University of Colombo School of Computing 1 IT 1204 Section 2.0 Data Representation and Arithmetic 2009, University of Colombo School of Computing 1 What is Analog and Digital The interpretation of an analog signal would correspond to a signal whose

More information

CHAPTER V NUMBER SYSTEMS AND ARITHMETIC

CHAPTER V NUMBER SYSTEMS AND ARITHMETIC CHAPTER V-1 CHAPTER V CHAPTER V NUMBER SYSTEMS AND ARITHMETIC CHAPTER V-2 NUMBER SYSTEMS RADIX-R REPRESENTATION Decimal number expansion 73625 10 = ( 7 10 4 ) + ( 3 10 3 ) + ( 6 10 2 ) + ( 2 10 1 ) +(

More information

T02 Tutorial Slides for Week 2

T02 Tutorial Slides for Week 2 T02 Tutorial Slides for Week 2 ENEL 353: Digital Circuits Fall 2017 Term Steve Norman, PhD, PEng Electrical & Computer Engineering Schulich School of Engineering University of Calgary 19 September, 2017

More information

Slide Set 1. for ENEL 353 Fall Steve Norman, PhD, PEng. Electrical & Computer Engineering Schulich School of Engineering University of Calgary

Slide Set 1. for ENEL 353 Fall Steve Norman, PhD, PEng. Electrical & Computer Engineering Schulich School of Engineering University of Calgary Slide Set 1 for ENEL 353 Fall 2017 Steve Norman, PhD, PEng Electrical & Computer Engineering Schulich School of Engineering University of Calgary Fall Term, 2017 SN s ENEL 353 Fall 2017 Slide Set 1 slide

More information

INF2270 Spring Philipp Häfliger. Lecture 4: Signed Binaries and Arithmetic

INF2270 Spring Philipp Häfliger. Lecture 4: Signed Binaries and Arithmetic INF2270 Spring 2010 Philipp Häfliger Lecture 4: Signed Binaries and Arithmetic content Karnaugh maps revisited Binary Addition Signed Binary Numbers Binary Subtraction Arithmetic Right-Shift and Bit Number

More information

Chapter 10 Binary Arithmetics

Chapter 10 Binary Arithmetics 27..27 Chapter Binary Arithmetics Dr.-Ing. Stefan Werner Table of content Chapter : Switching Algebra Chapter 2: Logical Levels, Timing & Delays Chapter 3: Karnaugh-Veitch-Maps Chapter 4: Combinational

More information

Positional notation Ch Conversions between Decimal and Binary. /continued. Binary to Decimal

Positional notation Ch Conversions between Decimal and Binary. /continued. Binary to Decimal Positional notation Ch.. /continued Conversions between Decimal and Binary Binary to Decimal - use the definition of a number in a positional number system with base - evaluate the definition formula using

More information

CO Computer Architecture and Programming Languages CAPL. Lecture 9

CO Computer Architecture and Programming Languages CAPL. Lecture 9 CO20-320241 Computer Architecture and Programming Languages CAPL Lecture 9 Dr. Kinga Lipskoch Fall 2017 A Four-bit Number Circle CAPL Fall 2017 2 / 38 Functional Parts of an ALU CAPL Fall 2017 3 / 38 Addition

More information

Numbering systems. Dr Abu Arqoub

Numbering systems. Dr Abu Arqoub Numbering systems The decimal numbering system is widely used, because the people Accustomed (معتاد) to use the hand fingers in their counting. But with the development of the computer science another

More information

Module 2: Computer Arithmetic

Module 2: Computer Arithmetic Module 2: Computer Arithmetic 1 B O O K : C O M P U T E R O R G A N I Z A T I O N A N D D E S I G N, 3 E D, D A V I D L. P A T T E R S O N A N D J O H N L. H A N N E S S Y, M O R G A N K A U F M A N N

More information

Number System (Different Ways To Say How Many) Fall 2016

Number System (Different Ways To Say How Many) Fall 2016 Number System (Different Ways To Say How Many) Fall 2016 Introduction to Information and Communication Technologies CSD 102 Email: mehwish.fatima@ciitlahore.edu.pk Website: https://sites.google.com/a/ciitlahore.edu.pk/ict/

More information

ECE 2030D Computer Engineering Spring problems, 5 pages Exam Two 8 March 2012

ECE 2030D Computer Engineering Spring problems, 5 pages Exam Two 8 March 2012 Instructions: This is a closed book, closed note exam. Calculators are not permitted. If you have a question, raise your hand and I will come to you. Please work the exam in pencil and do not separate

More information

Chapter 4: Computer Codes. In this chapter you will learn about:

Chapter 4: Computer Codes. In this chapter you will learn about: Ref. Page 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 Ref. Page

More information

Chapter 3: Number Systems and Codes. Textbook: Petruzella, Frank D., Programmable Logic Controllers. McGraw Hill Companies Inc.

Chapter 3: Number Systems and Codes. Textbook: Petruzella, Frank D., Programmable Logic Controllers. McGraw Hill Companies Inc. Chapter 3: Number Systems and Codes Textbook: Petruzella, Frank D., Programmable Logic Controllers. McGraw Hill Companies Inc., 5 th edition Decimal System The radix or base of a number system determines

More information

Integers. N = sum (b i * 2 i ) where b i = 0 or 1. This is called unsigned binary representation. i = 31. i = 0

Integers. N = sum (b i * 2 i ) where b i = 0 or 1. This is called unsigned binary representation. i = 31. i = 0 Integers So far, we've seen how to convert numbers between bases. How do we represent particular kinds of data in a certain (32-bit) architecture? We will consider integers floating point characters What

More information

9/3/2015. Data Representation II. 2.4 Signed Integer Representation. 2.4 Signed Integer Representation

9/3/2015. Data Representation II. 2.4 Signed Integer Representation. 2.4 Signed Integer Representation Data Representation II CMSC 313 Sections 01, 02 The conversions we have so far presented have involved only unsigned numbers. To represent signed integers, computer systems allocate the high-order bit

More information

Chapter 2 Bits, Data Types, and Operations

Chapter 2 Bits, Data Types, and Operations Chapter 2 Bits, Data Types, and Operations How do we represent data in a computer? At the lowest level, a computer is an electronic machine. works by controlling the flow of electrons Easy to recognize

More information

Ms Sandhya Rani Dash UNIT 2: NUMBER SYSTEM AND CODES. 1.1 Introduction

Ms Sandhya Rani Dash UNIT 2: NUMBER SYSTEM AND CODES. 1.1 Introduction Ms Sandhya Rani Dash UNIT 2: NUMBER SYSTEM AND CODES Structure 2.1 Introduction 2.2 Objectives 2.3 Binary Numbers 2.3.1 Binary-to-Decimal conversion 2.3.2 Decimal-to-Binary Conversion 2.4 Octal Numbers

More information

Principles of Computer Architecture. Chapter 3: Arithmetic

Principles of Computer Architecture. Chapter 3: Arithmetic 3-1 Chapter 3 - Arithmetic Principles of Computer Architecture Miles Murdocca and Vincent Heuring Chapter 3: Arithmetic 3-2 Chapter 3 - Arithmetic 3.1 Overview Chapter Contents 3.2 Fixed Point Addition

More information

Digital Fundamentals. CHAPTER 2 Number Systems, Operations, and Codes

Digital Fundamentals. CHAPTER 2 Number Systems, Operations, and Codes Digital Fundamentals CHAPTER 2 Number Systems, Operations, and Codes Decimal Numbers The decimal number system has ten digits: 0, 1, 2, 3, 4, 5, 6, 7, 8, and 9 The decimal numbering system has a base of

More information

DLD VIDYA SAGAR P. potharajuvidyasagar.wordpress.com. Vignana Bharathi Institute of Technology UNIT 1 DLD P VIDYA SAGAR

DLD VIDYA SAGAR P. potharajuvidyasagar.wordpress.com. Vignana Bharathi Institute of Technology UNIT 1 DLD P VIDYA SAGAR UNIT I Digital Systems: Binary Numbers, Octal, Hexa Decimal and other base numbers, Number base conversions, complements, signed binary numbers, Floating point number representation, binary codes, error

More information

24 Nov Boolean Operations. Boolean Algebra. Boolean Functions and Expressions. Boolean Functions and Expressions

24 Nov Boolean Operations. Boolean Algebra. Boolean Functions and Expressions. Boolean Functions and Expressions 24 Nov 25 Boolean Algebra Boolean algebra provides the operations and the rules for working with the set {, }. These are the rules that underlie electronic circuits, and the methods we will discuss are

More information

ECE 2030B 1:00pm Computer Engineering Spring problems, 5 pages Exam Two 10 March 2010

ECE 2030B 1:00pm Computer Engineering Spring problems, 5 pages Exam Two 10 March 2010 Instructions: This is a closed book, closed note exam. Calculators are not permitted. If you have a question, raise your hand and I will come to you. Please work the exam in pencil and do not separate

More information

Rui Wang, Assistant professor Dept. of Information and Communication Tongji University.

Rui Wang, Assistant professor Dept. of Information and Communication Tongji University. Data Representation ti and Arithmetic for Computers Rui Wang, Assistant professor Dept. of Information and Communication Tongji University it Email: ruiwang@tongji.edu.cn Questions What do you know about

More information

Chapter 2 Bits, Data Types, and Operations

Chapter 2 Bits, Data Types, and Operations Chapter Bits, Data Types, and Operations How do we represent data in a computer? At the lowest level, a computer is an electronic machine. works by controlling the flow of electrons Easy to recognize two

More information

Korea University of Technology and Education

Korea University of Technology and Education MEC52 디지털공학 Binary Systems Jee-Hwan Ryu School of Mechanical Engineering Binary Numbers a 5 a 4 a 3 a 2 a a.a - a -2 a -3 base or radix = a n r n a n- r n-...a 2 r 2 a ra a - r - a -2 r -2...a -m r -m

More information

Number Systems and Conversions UNIT 1 NUMBER SYSTEMS & CONVERSIONS. Number Systems (2/2) Number Systems (1/2) Iris Hui-Ru Jiang Spring 2010

Number Systems and Conversions UNIT 1 NUMBER SYSTEMS & CONVERSIONS. Number Systems (2/2) Number Systems (1/2) Iris Hui-Ru Jiang Spring 2010 Contents Number systems and conversion Binary arithmetic Representation of negative numbers Addition of two s complement numbers Addition of one s complement numbers Binary s Readings Unit.~. UNIT NUMBER

More information

2. MACHINE REPRESENTATION OF TYPICAL ARITHMETIC DATA FORMATS (NATURAL AND INTEGER NUMBERS).

2. MACHINE REPRESENTATION OF TYPICAL ARITHMETIC DATA FORMATS (NATURAL AND INTEGER NUMBERS). 2. MACHINE REPRESENTATION OF TYPICAL ARITHMETIC DATA FORMATS (NATURAL AND INTEGER NUMBERS). 2.. Natural Binary Code (NBC). The positional code with base 2 (B=2), introduced in Exercise, is used to encode

More information

Data Representation 1

Data Representation 1 1 Data Representation Outline Binary Numbers Adding Binary Numbers Negative Integers Other Operations with Binary Numbers Floating Point Numbers Character Representation Image Representation Sound Representation

More information

CHAPTER 2 (b) : AND CODES

CHAPTER 2 (b) : AND CODES DKT 122 / 3 DIGITAL SYSTEMS 1 CHAPTER 2 (b) : NUMBER SYSTEMS OPERATION AND CODES m.rizal@unimap.edu.my sitizarina@unimap.edu.my DECIMAL VALUE OF SIGNED NUMBERS SIGN-MAGNITUDE: Decimal values of +ve & -ve

More information

Chapter 2 Data Representations

Chapter 2 Data Representations Computer Engineering Chapter 2 Data Representations Hiroaki Kobayashi 4/21/2008 4/21/2008 1 Agenda in Chapter 2 Translation between binary numbers and decimal numbers Data Representations for Integers

More information

Electronic Data and Instructions

Electronic Data and Instructions Lecture 2 - The information Layer Binary Values and Number Systems, Data Representation. Know the different types of numbers Describe positional notation Convert numbers in other bases to base 10 Convert

More information

Number Systems. Both numbers are positive

Number Systems. Both numbers are positive Number Systems Range of Numbers and Overflow When arithmetic operation such as Addition, Subtraction, Multiplication and Division are performed on numbers the results generated may exceed the range of

More information

CHAPTER 2 Data Representation in Computer Systems

CHAPTER 2 Data Representation in Computer Systems CHAPTER 2 Data Representation in Computer Systems 2.1 Introduction 37 2.2 Positional Numbering Systems 38 2.3 Decimal to Binary Conversions 38 2.3.1 Converting Unsigned Whole Numbers 39 2.3.2 Converting

More information

D I G I T A L C I R C U I T S E E

D I G I T A L C I R C U I T S E E D I G I T A L C I R C U I T S E E Digital Circuits Basic Scope and Introduction This book covers theory solved examples and previous year gate question for following topics: Number system, Boolean algebra,

More information

Number representations

Number representations Number representations Number bases Three number bases are of interest: Binary, Octal and Hexadecimal. We look briefly at conversions among them and between each of them and decimal. Binary Base-two, or

More information

Solutions - Homework 2 (Due date: October 4 5:30 pm) Presentation and clarity are very important! Show your procedure!

Solutions - Homework 2 (Due date: October 4 5:30 pm) Presentation and clarity are very important! Show your procedure! Solutions - Homework 2 (Due date: October 4 th @ 5:30 pm) Presentation and clarity are very important! Show your procedure! PROBLEM 1 (28 PTS) a) What is the minimum number of bits required to represent:

More information

Chapter 2 Number System

Chapter 2 Number System Chapter 2 Number System Embedded Systems with ARM Cortext-M Updated: Tuesday, January 16, 2018 What you should know.. Before coming to this class Decimal Binary Octal Hex 0 0000 00 0x0 1 0001 01 0x1 2

More information

Module 1: Information Representation I -- Number Systems

Module 1: Information Representation I -- Number Systems Unit 1: Computer Systems, pages 1 of 7 - Department of Computer and Mathematical Sciences CS 1305 Intro to Computer Technology 1 Module 1: Information Representation I -- Number Systems Objectives: Learn

More information

World Inside a Computer is Binary

World Inside a Computer is Binary C Programming 1 Representation of int data World Inside a Computer is Binary C Programming 2 Decimal Number System Basic symbols: 0, 1, 2, 3, 4, 5, 6, 7, 8, 9 Radix-10 positional number system. The radix

More information

EE292: Fundamentals of ECE

EE292: Fundamentals of ECE EE292: Fundamentals of ECE Fall 2012 TTh 10:00-11:15 SEB 1242 Lecture 22 121115 http://www.ee.unlv.edu/~b1morris/ee292/ 2 Outline Review Binary Number Representation Binary Arithmetic Combinatorial Logic

More information

EE 109 Unit 6 Binary Arithmetic

EE 109 Unit 6 Binary Arithmetic EE 109 Unit 6 Binary Arithmetic 1 2 Semester Transition Point At this point we are going to start to transition in our class to look more at the hardware organization and the low-level software that is

More information

Microcomputers. Outline. Number Systems and Digital Logic Review

Microcomputers. Outline. Number Systems and Digital Logic Review Microcomputers Number Systems and Digital Logic Review Lecture 1-1 Outline Number systems and formats Common number systems Base Conversion Integer representation Signed integer representation Binary coded

More information

Data Representations & Arithmetic Operations

Data Representations & Arithmetic Operations Data Representations & Arithmetic Operations Hiroaki Kobayashi 7/13/2011 7/13/2011 Computer Science 1 Agenda Translation between binary numbers and decimal numbers Data Representations for Integers Negative

More information

Number Systems. Readings: , Problem: Implement simple pocket calculator Need: Display, adders & subtractors, inputs

Number Systems. Readings: , Problem: Implement simple pocket calculator Need: Display, adders & subtractors, inputs Number Systems Readings: 3-3.3.3, 3.3.5 Problem: Implement simple pocket calculator Need: Display, adders & subtractors, inputs Display: Seven segment displays Inputs: Switches Missing: Way to implement

More information

CHAPTER 2 Data Representation in Computer Systems

CHAPTER 2 Data Representation in Computer Systems CHAPTER 2 Data Representation in Computer Systems 2.1 Introduction 37 2.2 Positional Numbering Systems 38 2.3 Decimal to Binary Conversions 38 2.3.1 Converting Unsigned Whole Numbers 39 2.3.2 Converting

More information

data within a computer system are stored in one of 2 physical states (hence the use of binary digits)

data within a computer system are stored in one of 2 physical states (hence the use of binary digits) Binary Digits (bits) data within a computer system are stored in one of 2 physical states (hence the use of binary digits) 0V and 5V charge / NO charge on a transistor gate ferrite core magnetised clockwise

More information

CMPE223/CMSE222 Digital Logic Design. Positional representation

CMPE223/CMSE222 Digital Logic Design. Positional representation CMPE223/CMSE222 Digital Logic Design Number Representation and Arithmetic Circuits: Number Representation and Unsigned Addition Positional representation First consider integers Begin with positive only

More information

Digital Systems and Binary Numbers

Digital Systems and Binary Numbers Digital Systems and Binary Numbers Prof. Wangrok Oh Dept. of Information Communications Eng. Chungnam National University Prof. Wangrok Oh(CNU) 1 / 51 Overview 1 Course Summary 2 Binary Numbers 3 Number-Base

More information

CPE 323 REVIEW DATA TYPES AND NUMBER REPRESENTATIONS IN MODERN COMPUTERS

CPE 323 REVIEW DATA TYPES AND NUMBER REPRESENTATIONS IN MODERN COMPUTERS CPE 323 REVIEW DATA TYPES AND NUMBER REPRESENTATIONS IN MODERN COMPUTERS Aleksandar Milenković The LaCASA Laboratory, ECE Department, The University of Alabama in Huntsville Email: milenka@uah.edu Web:

More information

CPE 323 REVIEW DATA TYPES AND NUMBER REPRESENTATIONS IN MODERN COMPUTERS

CPE 323 REVIEW DATA TYPES AND NUMBER REPRESENTATIONS IN MODERN COMPUTERS CPE 323 REVIEW DATA TYPES AND NUMBER REPRESENTATIONS IN MODERN COMPUTERS Aleksandar Milenković The LaCASA Laboratory, ECE Department, The University of Alabama in Huntsville Email: milenka@uah.edu Web:

More information

Course Schedule. CS 221 Computer Architecture. Week 3: Plan. I. Hexadecimals and Character Representations. Hexadecimal Representation

Course Schedule. CS 221 Computer Architecture. Week 3: Plan. I. Hexadecimals and Character Representations. Hexadecimal Representation Course Schedule CS 221 Computer Architecture Week 3: Information Representation (2) Fall 2001 W1 Sep 11- Sep 14 Introduction W2 Sep 18- Sep 21 Information Representation (1) (Chapter 3) W3 Sep 25- Sep

More information

Groups of two-state devices are used to represent data in a computer. In general, we say the states are either: high/low, on/off, 1/0,...

Groups of two-state devices are used to represent data in a computer. In general, we say the states are either: high/low, on/off, 1/0,... Chapter 9 Computer Arithmetic Reading: Section 9.1 on pp. 290-296 Computer Representation of Data Groups of two-state devices are used to represent data in a computer. In general, we say the states are

More information

Final Labs and Tutors

Final Labs and Tutors ICT106 Fundamentals of Computer Systems - Topic 2 REPRESENTATION AND STORAGE OF INFORMATION Reading: Linux Assembly Programming Language, Ch 2.4-2.9 and 3.6-3.8 Final Labs and Tutors Venue and time South

More information

Introduction to Computer Science-103. Midterm

Introduction to Computer Science-103. Midterm Introduction to Computer Science-103 Midterm 1. Convert the following hexadecimal and octal numbers to decimal without using a calculator, showing your work. (6%) a. (ABC.D) 16 2748.8125 b. (411) 8 265

More information

Optional: Building a processor from scratch

Optional: Building a processor from scratch Optional: Building a processor from scratch In this assignment we are going build a computer processor from the ground up, starting with transistors, and ending with a small but powerful processor. The

More information

Digital Systems and Binary Numbers

Digital Systems and Binary Numbers Digital Systems and Binary Numbers ( 范倫達 ), Ph. D. Department of Computer Science National Chiao Tung University Taiwan, R.O.C. Spring, 2018 ldvan@cs.nctu.edu.tw http://www.cs.nctu.edu.tw/~ldvan/ Outline

More information

MYcsvtu Notes DATA REPRESENTATION. Data Types. Complements. Fixed Point Representations. Floating Point Representations. Other Binary Codes

MYcsvtu Notes DATA REPRESENTATION. Data Types. Complements. Fixed Point Representations. Floating Point Representations. Other Binary Codes DATA REPRESENTATION Data Types Complements Fixed Point Representations Floating Point Representations Other Binary Codes Error Detection Codes Hamming Codes 1. DATA REPRESENTATION Information that a Computer

More information

Digital Fundamentals

Digital Fundamentals Digital Fundamentals Tenth Edition Floyd Chapter 1 Modified by Yuttapong Jiraraksopakun Floyd, Digital Fundamentals, 10 th 2008 Pearson Education ENE, KMUTT ed 2009 Analog Quantities Most natural quantities

More information

Digital Systems. John SUM Institute of Technology Management National Chung Hsing University Taichung, ROC. December 6, 2012

Digital Systems. John SUM Institute of Technology Management National Chung Hsing University Taichung, ROC. December 6, 2012 Digital Systems John SUM Institute of Technology Management National Chung Hsing University Taichung, ROC December 6, 2012 Contents 1 Logic Gates 3 1.1 Logic Gate............................. 3 1.2 Truth

More information

Data Representation COE 301. Computer Organization Prof. Muhamed Mudawar

Data Representation COE 301. Computer Organization Prof. Muhamed Mudawar Data Representation COE 30 Computer Organization Prof. Muhamed Mudawar College of Computer Sciences and Engineering King Fahd University of Petroleum and Minerals Presentation Outline Positional Number

More information

DATA REPRESENTATION. By- Neha Tyagi PGT CS KV 5 Jaipur II Shift, Jaipur Region. Based on CBSE curriculum Class 11. Neha Tyagi, KV 5 Jaipur II Shift

DATA REPRESENTATION. By- Neha Tyagi PGT CS KV 5 Jaipur II Shift, Jaipur Region. Based on CBSE curriculum Class 11. Neha Tyagi, KV 5 Jaipur II Shift DATA REPRESENTATION Based on CBSE curriculum Class 11 By- Neha Tyagi PGT CS KV 5 Jaipur II Shift, Jaipur Region Neha Tyagi, KV 5 Jaipur II Shift Introduction As we know that computer system stores any

More information

COMP Overview of Tutorial #2

COMP Overview of Tutorial #2 COMP 1402 Winter 2008 Tutorial #2 Overview of Tutorial #2 Number representation basics Binary conversions Octal conversions Hexadecimal conversions Signed numbers (signed magnitude, one s and two s complement,

More information

20 Calculus and Structures

20 Calculus and Structures 0 Calculus and Structures CHAPTER FUNCTIONS Calculus and Structures Copright LESSON FUNCTIONS. FUNCTIONS A function f is a relationship between an input and an output and a set of instructions as to how

More information

Inf2C - Computer Systems Lecture 2 Data Representation

Inf2C - Computer Systems Lecture 2 Data Representation Inf2C - Computer Systems Lecture 2 Data Representation Boris Grot School of Informatics University of Edinburgh Last lecture Moore s law Types of computer systems Computer components Computer system stack

More information

Excerpt from: Stephen H. Unger, The Essence of Logic Circuits, Second Ed., Wiley, 1997

Excerpt from: Stephen H. Unger, The Essence of Logic Circuits, Second Ed., Wiley, 1997 Excerpt from: Stephen H. Unger, The Essence of Logic Circuits, Second Ed., Wiley, 1997 APPENDIX A.1 Number systems and codes Since ten-fingered humans are addicted to the decimal system, and since computers

More information