QUIZ ch.1. 1 st generation 2 nd generation 3 rd generation 4 th generation 5 th generation Rock s Law Moore s Law

Size: px
Start display at page:

Download "QUIZ ch.1. 1 st generation 2 nd generation 3 rd generation 4 th generation 5 th generation Rock s Law Moore s Law"

Transcription

1 QUIZ ch.1 1 st generation 2 nd generation 3 rd generation 4 th generation 5 th generation Rock s Law Moore s Law Integrated circuits Density of silicon chips doubles every 1.5 yrs. Multi-core CPU Transistors Cost of manufacturing infrastructure doubles every 4 yrs. Vacuum tubes VLSI

2 QUIZ ch.1 The highest # of transistors in a CPU commercially available today is about: 100 million 500 million 1 billion 2 billion 2.5 billion 5 billion

3 QUIZ ch.1 The highest # of transistors in a CPU commercially available today is about: 100 million 500 million 1 billion 2 billion 2.5 billion As of 2012, the highest transistor count in a commercially available CPU is over 2.5 billion transistors, in Intel's 10-core Xeon Westmere-EX. Xilinx currently holds the "world-record" for an FPGA containing 6.8 billion transistors. Source: Wikipedia Transistor_count

4 Chapter 2 Data Representation in Computer Systems

5 2.1 Introduction A bit is the most basic unit of information in a computer. It is a state of on or off in a digital circuit. Sometimes these states are high or low voltage instead of on or off.. A byte is a group of eight bits. A byte is the smallest possible addressable unit of computer storage. The term, addressable, means that a particular byte can be retrieved according to its location in memory. 5

6 2.1 Introduction A word is a contiguous group of bytes. Words can be any number of bits or bytes. Word sizes of 16, 32, or 64 bits are most common. Intel: 16 bits = 1 word, 32 bits = double word, 64 bits = quad word In a word-addressable system, a word is the smallest addressable unit of storage. 6

7 QUIZ A word is a contiguous group of bytes. Words can be any number of bits or bytes. Word sizes of 16, 32, or 64 bits are most common. Intel: 16 bits = 1 word, 32 bits = double word, 64 bits = quad word In a word-addressable system, a word is the smallest addressable unit of storage. Does the word size belong to the organization or architecture of a computer? 7

8 QUIZ What is the word size in the MARIE architecture?

9 The meaning of full n-bit computer (8, 16, 32, 64 etc.) 9 All data-related operations must be performed on n bits: Word size n bits MBR, AC n bits ALU n bits Data bus n bits / cycle n bit 1 transf./cycle n/2 bit 2 transf./cycle etc. Usually InReg, OutReg

10 The meaning of n-bit computer (8, 16, 32, 64 etc.) However, not all parameters of the computer need be exactly n bits: Opcode length Address length, PC, MAR Instruction length, IR It s even variable in CISC! 10

11 A group of four bits is called a nibble. (nybble??) Bytes consist of two nibbles: a high-order nibble, and a low-order nibble. In each case, find the h-o and l-o nibble: (binary) E7 (hex) 42 (dec) 325 (oct) 2.1 Introduction 11

12 2.2 Positional Numbering Systems Bytes store numbers using the position of each bit to represent a power of 2. The binary system is also called the base-2 system. Our decimal system is the base-10 system. It uses powers of 10 for each position in a number. Any integer quantity can be represented exactly using any base (or radix). 12

13 2.2 Positional Numbering Systems The decimal number 947 in powers of 10 is: The decimal number in powers of 10 is:

14 2.2 Positional Number Systems The binary number in powers of 2 is: = = 25 When the radix of a number is something other than 10, the base is denoted by a subscript. Sometimes, the subscript 10 is added for emphasis: =

15 2.3 Converting Between Bases Converting unsigned integers Two algorithms: 1.Top-down = repeated subtraction 2.Bottom-up = repeated division (and remainder) 15

16 Converting Repeated subtraction Example: convert the decimal number 190 to base 3. First question: how many digits are needed? A: 3 5 = 243 > 190 so our result will be less than five digits wide. The largest power of 3 that we need is therefore 3 4 = 81. How many times does 81 fit inside 190? A: 81 2 = 162. Write down the 2 and subtract from 190, giving 28.

17 Then repeat for the quantity that was left over: The next power of 3 is 3 3 = 27. We ll need one of these, so we subtract 27 and write down the numeral 1 in our result. The next power of 3, 3 2 = 9, is too large, but we have to assign a placeholder of zero and carry down the 1. 17

18 Continue until 3 0 (=1, a.k.a. units): 3 1 = 3 is again too large, so we assign a zero placeholder. The last power of 3, 3 0 = 1, is our last choice, and it gives us a difference of zero. Our result, reading from top to bottom is: =

19 19 Extra-credit QUIZ

20 Converting: repeated division Converting 190 to base 3... Our result, reading from bottom to top is: =

21 QUIZ Convert the decimal number 462 to base 5 using repeated division. 21

22 2.3 Converting Between Bases Converting unsigned fractions Fractional values can be approximated in all base systems. Unlike integes, fractions do not necessarily have exact representations under all bases. E.g. ½ (0.5 dec) is exactly representable in the binary and decimal systems, but not in base 3) 22

23 2.3 Converting Between Bases decimal point radix point Digits to the right of a radix point represent negative powers of the radix: = = = ½ + ¼ = =

24 2.3 Converting Between Bases As with integer conversions, we can use two methods: Repeated subtraction Repeated multiplication 24

25 Fractions: repeated subtraction Identical to the subtraction method for positive integers. Instead of subtracting positive powers of the target radix, we subtract negative powers of the radix. We always start with the largest value first, R -1, and work our way along using larger negative exponents. 25

26 Fractions: repeated subtraction Example: convert the decimal to binary. Our result, reading from top to bottom is: = Works with any base, not just binary! 26

27 Fractions: repeated subtraction QUIZ: convert the decimal 0.3 to binary. 27

28 Fractions: repeated multiplication Example: convert the decimal to binary First we multiply by the radix 2. The one in the units place is the first binary digit 28

29 Fractions: repeated multiplication Converting to binary... Ignoring the value in the units place, we continue multiplying each fractional part by the radix. 29

30 Fractions: repeated multiplication Converting to binary... We are finished when the product is zero, or we have reached the desired number of binary places. Reading bits from top to bottom: = This method also works with any base. Just use the target base as the multiplier. 30

31 Your turn! Convert the decimal 0.3 to binary by repeated multiplication. Use 8 bits of precision. 31

32 Individual work for next time Read pp of text Follow and understand examples 2.1 through 2.8 Solve in notebook end-of-chapter Ex.1 (p.117) 32

33 Larger Bases The binary numbering system is the most important radix system for digital computers. However, it is difficult to read long strings of binary numbers -- and even a modestly-sized decimal number becomes a very long binary number. For example: =

34 The 6-bit computers: Motivated by the 6-bit codes for printable graphic patterns common in the U.S. Army and Navy 6, 18, 26, 36, 48-bit words Some history: 18-Bit Computers from DEC 36-bit Wikipedia Edged out of the market by the need for floatingpoint IBM System/360 (1965) 8-bit microprocessors (1970s) 34 Octal an Evolutionary dead-end?

35 Octal an Evolutionary dead-end? Unisys is still successful with their 36- and 48- bit machines : Clearpath Dorado line of 36-bit CISC highend servers Clearpath Libra line of 48-bit mainframes although they are being transitioned to Intel Xeon chips (64-bit): see article 35

36 Hexadecimal For compactness and ease of reading, binary values are usually expressed using the hexadecimal (base 16) number system. The hex digits: 0 9, A, B, C, D, E, F It is easy to convert between base 16 and base 2, because 16 = 2 4 one-to-one correspondence between hex digits and groups of four bits A group of four binary digits is called a nibble or a hextet 36

37 Converting Between Bases which are powers of 2 is easy! Using hextets, the binary number (= ) in hexadecimal is: If the number of bits is not a multiple of 4, pad on the left with zeros. Octal (base 8) values are derived from binary by using groups of three bits (8 = 2 3 ): Octal was very useful when computers used six-bit words. 37

38 QUIZ: Convert from hex to octal? 2 A F 16 = 8 38

39 Operations with unsigned integers Addition Subtraction Multiplication Division They can all be performed with pencil and paper exactly as in decimal (carry, borrow, long division, etc.) 39

40 Operations with unsigned integers Addition Subtraction Multiplication Division Example: : 101 They can all be performed with pencil and paper exactly as in decimal (carry, borrow, long division, etc.) 40

41 2.4 Signed Integer Representation To represent signed integers, computer use the highorder bit to indicate the sign of a number. The high-order bit is the leftmost bit, a.k.a. the most significant bit (MSB). An MSB of 0 indicates a positive number; an MSB of 1 indicates a negative number. The remaining bits contain the magnitude of the number (but this magnitude can be interpreted different ways) 41

42 2.4 Signed Integer Representation There are 3 ways in which signed binary integers have been expressed in computers: Signed magnitude One s complement Two s complement 42

43 Pros and cons of Sign-Magnitude representation It is easy for people to understand, but it requires complicated computer hardware. It allows two different representations for zero: positive zero and negative zero. SKIP the rest of Section

44 Complement systems Idea: Negative values are represented by the difference between a high power of the base and the absolute value. The diminished radix complement of a non-zero number N in base r with d digits is (r d 1) N In the binary system, this gives us one s complement. It amounts to flipping the bits of a binary number. Example: in 8-bit one s complement we have + 3 is: is:

45 One s Complement Example: in 8-bit one s complement we have + 3 is: is: In one s complement, negative values are still indicated by a 1 in the MSB. Complement systems are useful because they eliminate the need for subtraction. The difference of two values is found by adding the minuend to the complement of the subtrahend. 45

46 Pros and cons of one s complement It is much simpler to implement than signed magnitude. It still has two different representations for zero: positive zero negative zero SKIP in section until Two s Complement 46

47 Two s complement Instead of the diminished radix complement (r d 1) N, we use the simple, (nondiminished) radix complement: r d N One s complement is still useful: flip the bits, then add one (to cancel the -1) 47

48 Two s complement To express a value in two s complement: If the number is positive, just convert it to binary and you re done. If the number is negative, find the one s complement of the number and then add 1. i.e. FLIP ALL THE BITS Example: In 8-bit binary, 3 is: using one s complement representation is: Adding 1 gives us -3 in two s complement form:

49 Your turn: Write 21 and -21 in 8-bit two s complement 49

50 Your turn: Convert these two s complement numbers to decimal:

51 QUIZ: What does the all ones combination mean in two s complement? (on any number of bits) 51

52 Two s complement arithmetic All we do is add our two binary numbers. Just discard any carries emitting from the high order bit. Example: Find the sum of 48 and -19 We note that 19 in binary is: , so -19 using one s complement is: , and -19 using two s complement is:

53 Example: Overflow in two s complement Find the sum of 107 and 46. We see that the nonzero carry from the seventh bit overflows into the sign bit, giving us the erroneous result: = But overflow into the sign bit does not always mean that we have an error! 53

54 Overflow in two s complement Example: Find the sum of 23 and -9. We see that there is carry into the sign bit, but the final result is correct: 23 + (-9) = 14. This is because there is also carry out of the sign bit! Rule for detecting signed two s complement overflow: When the carry in and the carry out of the sign bit differ, overflow has occurred. If the carry into the sign bit equals the carry out of the sign bit, no overflow has occurred. 54

55 2.4.6 Carry vs. overflow For unsigned numbers overflow and carry are the same thing. For signed numbers carry is neither necessary nor sufficient for overflow. That is why most CPUs have two different flag bits: C V 55

56 2.4.3 Excess-M A.k.a. offset binary or biased representation We map the range of signed integers to unsigned by adding a bias M 56

57 2.4.4 Signed vs. unsigned integers Signed and unsigned numbers are both useful. For example, memory addresses are always unsigned. Using the same number of bits, unsigned integers can express twice as many positive values as signed numbers but they cannot represent negative numbers! 57

58 QUIZ: Signed vs. unsigned 8-bit words can represent how many Unsigned numbers? Two s complement numbers? 58

59 2.4.5 Binary multiplication Research into finding better arithmetic algorithms has continued for over 50 years. One of the many interesting products of this work is Booth s algorithm. In most cases, Booth s algorithm carries out multiplication faster and more accurately than naïve pencil-and-paper methods. The general idea is to replace arithmetic operations with bit shifting whenever possible. 59

60 Initialize product with all zeroes If the current multiplier bit is 1 and the preceding bit was 0, subtract the multiplicand from the product If the current multiplier bit is 0 and the preceding bit was 1, we add the multiplicand to the product If we have a 00 or 11 pair, do nothing. Shift (in all cases) Assume a mythical 0 bit in position -1 (to the right of MSB) Booth s algorithm 0011 x shift shift Multiplicand Multiplier subtract, then shift add, then shift 60 Check: 3 6 = 18

61 Booth s algorithm questions Q: How does the shifting work, exactly? A: The shift moves the multiplier to the left one position, setting it up for the next step. Q: How do we subtract? A: We use two s complement, and extend the sign bit. 61 Check: 3 6 = 18

62 Booth s algorithm Example 2.26 bonus: the multiplicand can be negative! -3 x x (subtract). Check: 62-3 x 5 = -15

63 Individual work for next time Read pp of text Follow and understand examples 2.19 through 2.24 Solve in notebook end-of-chapter Ex.36 and 43 (use Booth s alg. when possible!) 63

64 Sign extension! Booth s algorithm Example 2.27 Ignore all bits over 2n x Check: = 6678

65 QUIZ Booth s algorithm Multiply 5 x 7 (use 4 bits) 65

66 QUIZ Booth s algorithm Multiply 5 x -7 (use 4 bits) 66

67 Multiplication and division by 2 A left arithmetic shift inserts a 0 in for the rightmost bit and shifts everything else left one bit; in effect, it multiplies by 2 A right arithmetic shift shifts everything one bit to the right, but copies the sign bit; it divides by 2 Let s look at some examples. 67

68 Multiply 11 by 2 using 8-bit signed two s complement representation. We start with the binary value for 11: (+11) We shift left one place, resulting in: (+22) The sign bit has not changed, so the value is valid. 68 To multiply 11 by 4, we simply perform a left shift twice.

69 Divide the value 12 by 2, using 8-bit two s complement. We start with the binary value for 12: (+12) We shift left one place, resulting in: (+6) (Remember, we carry the sign bit to the left as we shift.) To divide 12 by 4, we right shift twice. 69

70 2.5 Floating-Point Representation The representations covered so far are only for integer values and fractional values with fixed precision. These data types are not useful in scientific or business applications that deal with very large/small real numbers. Floating-point representation solves this problem. 70

71 2.5 Floating-Point Representation Although FP representations can be implemented with software libraries, most of today s computers are equipped with specialized hardware that performs floating-point arithmetic with no special programming required. FPU, a.k.a. math coprocessor Intel 8086 and and 387 Since Intel 486DX, it is built into the CPU chip, i.e. integrated 71

72 2.5 Floating-Point Representation Floating-point numbers allow an arbitrary number of decimal places to the right of the decimal point. For example: = They are often expressed in scientific notation. For example: = ,000,000 =

73 2.5 Floating-Point Representation Computers use a form of scientific notation for floating-point representation Numbers written in scientific notation have three components: 73

74 2.5 Floating-Point Representation Computer representation of a floating-point number consists of three fixed-size fields: This is the standard arrangement of these fields. Note: Although significand and mantissa do not technically mean the same thing, many people use these terms interchangeably. We use the term significand to refer to the fractional part of a floating point number. 74

75 2.5 Floating-Point Representation The one-bit sign field is the sign of the stored value. The size of the exponent field determines the range of values that can be represented. The size of the significand determines the precision of the representation. 75

76 2.5 Floating-Point Representation We introduce a hypothetical Simple Model to explain the concepts In this model: A floating-point number is 14 bits in length The exponent field is 5 bits The significand field is 8 bits 76

77 2.5 Floating-Point Representation The significand is always preceded by an implied binary point. Thus, the significand always contains a fractional binary value. The exponent indicates the power of 2 by which the significand is multiplied. 77

78 2.5 Floating-Point Representation Example: Express in the simplified 14-bit floating-point model. We know that 32 is 2 5. So in (binary) scientific notation 32 = 1.0 x 2 5 = 0.1 x 2 6. Why did we choose the second form? see next slide Using this information, we put 110 (= 6 10 ) in the exponent field and 1 in the significand as shown. 78

79 These are all equivalent representations for 32: 0.1 x x 2 7 Problem x x 2 9 Not only do these synonymous representations waste space, but they also require complex hardware to test for equality! 79

80 Solution We establish a rule that the first digit of the significand must be 1, with no ones to the left of the radix point. This process, called normalization, results in a unique pattern for each floating-point number. In our simple model, all significands must have the form 0.1xxxxxxxx For example, 4.5 = x 2 0 = x 2 2 = x 2 3. The last expression is correctly normalized. 80

81 QUIZ Represent in the 14-bit floating-point model, normalized. 81

82 Normalization, results in a unique pattern for each floating-point number. In our simple model, all significands must have the form 0.1xxxxxxxx For example, 4.5 = x 2 0 = x 2 2 = x 2 3. The last expression is correctly normalized. If this bit is always one, why waste memory representing it?! 82

83 Normalization, results in a unique pattern for each floating-point number. In our simple model, all significands must have the form 0.1xxxxxxxx For example, 4.5 = x 2 0 = x 2 2 = x 2 3. The last expression is correctly normalized. If this bit is always one, why waste memory representing it?! Indeed, the IEEE-754 standard uses an implied bit. 83

84 Individual work for next time Read pp of text Follow and understand examples 2.25 through 2.31 Solve in notebook Ex. 25 a, 26 /

85 2.5 Floating-Point Representation Another problem We cannot represent negative exponents, b/c there is no sign in the exponent field. E.g. we have no way to express 0.5 =2-1 85

86 Solution We use a biased exponent. A bias is a number that is approximately midway in the range of values expressible by the exponent. We subtract the bias from the value in the exponent to determine its true value. In our case, we have a 5-bit exponent. We take 2 5 / 2-1 = 15 for our bias. This is called excess-15 representation. In our model, exponent values < 15 are negative, representing fractional numbers. 86

87 Example: Express in the revised 14-bit floating-point model including the implied bit. 87

88 QUIZ: Express in the revised 14-bit floating-point model. We know that is 2-4. So in (binary) scientific notation = 1.0 x 2-4 = 0.1 x 2-3 Add 15 to -3, giving =

89 QUIZ: Express in the revised 14-bit floating-point model. 89

90 QUIZ: Express in the revised 14-bit floating-point model. We find = Normalizing, we have: = x 2 5 Add 15 to 5, giving = We also need a 1 in the sign bit. 90

91 QUIZ: Given the 14-bit floating-point model representation 36 C0, find the number that is represented 91

92 Overflow and underflow What is the largest number (in absolute value) that can be represented in our 14-bit model? 92

93 Overflow and underflow What is the largest number (in absolute value) that can be represented in our 14-bit model? ± = ± = 65, = x = ± 65, / sign expo significand 93

94 EXTRA-CREDIT QUIZ: 94

95 Floating-Point Addition and Subtraction FP addition and subtraction are done w/methods analogous to those for pencil and paper: First express both operands in the same exponential power Add the numbers, preserving the exponent in the sum If the exponent requires adjustment, do so at the end 95

96 96

97 Your turn: Find the sum of and using the 14-bit biased FP model. 97

98 Floating-Point Errors Example: the 14-bit model cannot exactly represent the decimal value 128.5, b/c it has 9 bits: = Even if the initial numbers are represented exactly, each arithmetic operation can introduce errors due to normalization Errors can be compounded through repetitive arithmetic operations 98

99 The programmer s job is to: Floating-Point Errors Eliminate or reduce errors, by using appropriate numerical algorithms Example: Evaluate n-choose-(n-2) Evaluate the magnitude of the errors n n 2 Loss of MSB Example: = 128(!) e = Loss of LSB 0.39% Conclusion: Avoid numbers of very different magnitudes! 99

100 Floating-Point Errors Compounded errors example: % A procedure repetitively adds 0.5 to 128: Correct values are: 128.5, 129, 129.5, 130 Actual values with the 14-bit model are What is the absolute error after 10 iterations? What is the relative error after 10 iterations? 100

101 What can happen? FP overflow and underflow can cause programs to crash. Overflow occurs when there is no room to store the high-order bits resulting from a calculation. Underflow occurs when a value is too small to store, possibly resulting in division by zero. Loss of LSB is less dramatic, but due to compounding of errors is can be more dangerous! 101 It s better for a program to crash than to have it produce incorrect, but plausible, results.

102 Individual work for next time Read pp of text Read and understand the repeated multiplication example in Table 2.3/79 Read and take notes in notebook: Section IEEE-754 Solve in notebook Ex. 27,

103 FP review QUIZ: Find the product of 7 10 and using the 14-bit biased FP model. Use Booth s algorithm! Show all the steps! 103

104 2.5.4 IEEE-754 The IEEE has established a standard for floatingpoint numbers: Single (32 bit), Double (64 bit) and Quad (128 bit) precisions What is different from the simplified 14-bit model: The significant has an implied 1 to the LEFT of the binary point. Denormalized numbers can be represented Non-numbers can be represented: ±, NaN (Not 104

105 IEEE 754 Single, double and quadruple precision 32, 64, 128 bits Sources:

106 Try it out with an online calculator! (Link is on our webpage) 106

107 SKIP the remainder of this section We only require working knowledge of the 14-bit simplified model in this class 107

108 2.5.5 Range, precision, accuracy The range of a numeric integer format is the difference between the largest and smallest values that can be expressed Calculate the ranges for: 8-bit unsigned integers 8-bit signed integers (2 s complement) 14-bit simple FP model 32-bit double precision (IEEE 754) 108

109 Range, precision, accuracy

110 2.5.5 Range, precision, accuracy Accuracy means how closely a numeric representation approximates a true value. The precision of a number indicates how much information we have about a value. 110

111 Precision vs. accuracy Most of the time, greater precision leads to better accuracy For example when adding and multiplying numbers but this is not always true. For example, is a value of pi (= ) that is accurate to two digits, but has five digits of precision. 111

112 Because of truncated bits, we cannot always assume that a particular floating point operation is commutative or distributive. Example: we cannot assume: (a + b) + c = a + (b + c) a*(b + c) = ab + ac 112

113 To test a floating point value for equality to some other number, it is best to declare a nearness to x epsilon value. For example, instead of checking to see if floating point x is equal to 2 as follows: if x = 2 then it is better to use: epsilon if (abs(x - 2) < epsilon) then... (assuming we have epsilon defined correctly!) 113

114 2.6 Character Codes As computers have evolved, character codes have evolved, b/c larger computer memories and storage devices make possible the use of richer character codes. Short history of codes: Baudot (5 bit) BCD (6-bit) EBCDIC (8 bit) ASCII (7-bit) Unicode (16-bit) The earliest computer coding systems used 6 bits. Binary-coded decimal (BCD) was one of these early codes. It was used by IBM mainframes in the 1950s and 1960s. 114

115 2.6 Character Codes In 1964, BCD was extended to an 8-bit code, Extended Binary-Coded Decimal Interchange Code (EBCDIC). EBCDIC was one of the first widely-used computer codes that supported upper and lowercase alphabetic characters, in addition to special characters, such as punctuation and control characters. EBCDIC and BCD are still in use in IBM mainframes today! 115

116 ASCII Other computer manufacturers chose the 7-bit ASCII (American Standard Code for Information Interchange) as a replacement for 6-bit codes. While BCD and EBCDIC were based upon punched card codes, ASCII was based upon telecommunications (Telex) codes. Until recently (~2008), ASCII was the dominant character code outside the IBM mainframe world. Later extended ASCII evolved so that all eight bits were used How many characters can be represented? 116

117 117 7-bit ASCII Character Set

118 QUIZ Encode Hello, world! in ASCII Decode

119 The ASCII Character Set The first 32 characters in the ASCII character chart do not have a simple character representation to print to the screen. They are called control characters 119

120 Not in text Control Character: newline Source: 120

121 Not in text 8-bit ( extended ) ASCII Character Sets By using 8 bits instead of 7, the number of codes extends from 128 to 256. Extended ASCII is always a superset of 7-bit ASCII: The first 128 characters correspond exactly to 7-bit ASCII Problem??? 121

122 Not in text Extended ASCII: IBM code page

123 Not in text Extended ASCII: Latin

124 Trick QUIZ What do these bits represent?

125 Trick QUIZ What do these bits represent? Unsigned integer: Signed integer (2 s complement): Fixed-point fraction IBM 437 character: Latin-1 character: 125

126 QUIZ: Your boss tells you to develop a webpage using the extended ASCII character set. What do you reply? 126

127 2.6 Character Codes Many of today s systems embrace Unicode, a 16-bit system that can encode the characters of every language in the world. The Java programming language, and some operating systems now use Unicode as their default character code. The Unicode codespace is divided into six parts. The first part is for Western alphabet codes, including English, Greek, and Russian. 127

128 2.6 Character Codes The Unicode codespace allocation is shown at the right. The lowest-numbered Unicode characters comprise the ASCII code. The highest provide for user-defined codes. 128

129 The Unicode Character Set None of the Extended ASCII character sets were enough for international use (256!) Unicode uses 16 bits per character How many characters can UNICODE represent? Unicode is a superset of Latin-1: The first 256 characters correspond exactly to Latin-1 characters ( ) 129 Simplified Chinese has 6500!

130 130 Figure 3.6 A few characters in the Unicode character set Unicode examples

131 Miscellaneous Characters in Unicode 131 See more online at the official Unicode site

132 Romanian Characters in Unicode Part of the Latin-Extended-B character sub-set 132

133 Miscellaneous Characters in Unicode 133 See more online at the official Unicode site

134 QUIZ Select all that apply: The Latin-1 character set: Is a 5-bit representation Is a 7-bit representation Is a 16-bit representation Is an extension of ASCII Is an extension of Unicode Contains letters used in European languages 134

135 QUIZ Select all that apply: The Unicode representation: Uses 16 bits Is an extension of ASCII Is an extension of Latin-1 Is an extension of IBM-437 Contains letters used in all world languages Can accommodate over 65,000 characters Is used in the majority of web pages today 135 EOL4

136 2.7 Error Detection and Correction SKIP! (We cover this in Networks) 136

137 Homework for Ch.2 Due Tue, Sep.23 End-of-chapter exercises: 2, 4, 8, only two s comp only two s comp. 31, use Booth s algorithm 45, 58,

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

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. 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

Chapter 2. Data Representation in Computer Systems. Objectives (1 of 2) Objectives (2 of 2)

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

More information

Announcement. (CSC-3501) Lecture 3 (22 Jan 2008) Today, 1 st homework will be uploaded at our class website. Seung-Jong Park (Jay)

Announcement. (CSC-3501) Lecture 3 (22 Jan 2008) Today, 1 st homework will be uploaded at our class website. Seung-Jong Park (Jay) Computer Architecture (CSC-3501) Lecture 3 (22 Jan 2008) Seung-Jong Park (Jay) http://www.csc.lsu.edu/~sjpark 1 Announcement Today, 1 st homework will be uploaded at our class website Due date is the beginning

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

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

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. Binary Values and Number Systems

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

More information

QUIZ: Generations of computer technology. Hardware:

QUIZ: Generations of computer technology. Hardware: QUIZ: Generations of computer technology Hardware: 1. 2. 3. 4. 5. 1 QUIZ: Generations of computer technology Software: 1. 2. 3. 4. 5. 6. 2 Chapter 2 Binary Values and Number Systems Numbers Natural numbers,

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

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

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

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

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

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

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

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

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

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

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

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

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

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

Topic Notes: Bits and Bytes and Numbers

Topic Notes: Bits and Bytes and Numbers Computer Science 220 Assembly Language & Comp Architecture Siena College Fall 2010 Topic Notes: Bits and Bytes and Numbers Binary Basics At least some of this will be review, but we will go over it for

More information

Data Representation Type of Data Representation Integers Bits Unsigned 2 s Comp Excess 7 Excess 8

Data Representation Type of Data Representation Integers Bits Unsigned 2 s Comp Excess 7 Excess 8 Data Representation At its most basic level, all digital information must reduce to 0s and 1s, which can be discussed as binary, octal, or hex data. There s no practical limit on how it can be interpreted

More information

COMP2121: Microprocessors and Interfacing. Number Systems

COMP2121: Microprocessors and Interfacing. Number Systems COMP2121: Microprocessors and Interfacing Number Systems http://www.cse.unsw.edu.au/~cs2121 Lecturer: Hui Wu Session 2, 2017 1 1 Overview Positional notation Decimal, hexadecimal, octal and binary Converting

More information

Binary Addition & Subtraction. Unsigned and Sign & Magnitude numbers

Binary Addition & Subtraction. Unsigned and Sign & Magnitude numbers Binary Addition & Subtraction Unsigned and Sign & Magnitude numbers Addition and subtraction of unsigned or sign & magnitude binary numbers by hand proceeds exactly as with decimal numbers. (In fact this

More information

Lecture (02) Operations on numbering systems

Lecture (02) Operations on numbering systems Lecture (02) Operations on numbering systems By: Dr. Ahmed ElShafee ١ Dr. Ahmed ElShafee, ACU : Spring 2018, CSE202 Logic Design I Complements of a number Complements are used in digital computers to simplify

More information

COMP2611: Computer Organization. Data Representation

COMP2611: Computer Organization. Data Representation COMP2611: Computer Organization Comp2611 Fall 2015 2 1. Binary numbers and 2 s Complement Numbers 3 Bits: are the basis for binary number representation in digital computers What you will learn here: How

More information

Chapter 4: Data Representations

Chapter 4: Data Representations Chapter 4: Data Representations Integer Representations o unsigned o sign-magnitude o one's complement o two's complement o bias o comparison o sign extension o overflow Character Representations Floating

More information

Computer Science 324 Computer Architecture Mount Holyoke College Fall Topic Notes: Bits and Bytes and Numbers

Computer Science 324 Computer Architecture Mount Holyoke College Fall Topic Notes: Bits and Bytes and Numbers Computer Science 324 Computer Architecture Mount Holyoke College Fall 2007 Topic Notes: Bits and Bytes and Numbers Number Systems Much of this is review, given the 221 prerequisite Question: how high can

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

Homework 1 graded and returned in class today. Solutions posted online. Request regrades by next class period. Question 10 treated as extra credit

Homework 1 graded and returned in class today. Solutions posted online. Request regrades by next class period. Question 10 treated as extra credit Announcements Homework 1 graded and returned in class today. Solutions posted online. Request regrades by next class period. Question 10 treated as extra credit Quiz 2 Monday on Number System Conversions

More information

Organisasi Sistem Komputer

Organisasi Sistem Komputer LOGO Organisasi Sistem Komputer OSK 8 Aritmatika Komputer 1 1 PT. Elektronika FT UNY Does the calculations Arithmetic & Logic Unit Everything else in the computer is there to service this unit Handles

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

CS 265. Computer Architecture. Wei Lu, Ph.D., P.Eng.

CS 265. Computer Architecture. Wei Lu, Ph.D., P.Eng. CS 265 Computer Architecture Wei Lu, Ph.D., P.Eng. 1 Part 1: Data Representation Our goal: revisit and re-establish fundamental of mathematics for the computer architecture course Overview: what are bits

More information

CO212 Lecture 10: Arithmetic & Logical Unit

CO212 Lecture 10: Arithmetic & Logical Unit CO212 Lecture 10: Arithmetic & Logical Unit Shobhanjana Kalita, Dept. of CSE, Tezpur University Slides courtesy: Computer Architecture and Organization, 9 th Ed, W. Stallings Integer Representation For

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

M1 Computers and Data

M1 Computers and Data M1 Computers and Data Module Outline Architecture vs. Organization. Computer system and its submodules. Concept of frequency. Processor performance equation. Representation of information characters, signed

More information

Signed umbers. Sign/Magnitude otation

Signed umbers. Sign/Magnitude otation Signed umbers So far we have discussed unsigned number representations. In particular, we have looked at the binary number system and shorthand methods in representing binary codes. With m binary digits,

More information

UNIT - I: COMPUTER ARITHMETIC, REGISTER TRANSFER LANGUAGE & MICROOPERATIONS

UNIT - I: COMPUTER ARITHMETIC, REGISTER TRANSFER LANGUAGE & MICROOPERATIONS UNIT - I: COMPUTER ARITHMETIC, REGISTER TRANSFER LANGUAGE & MICROOPERATIONS (09 periods) Computer Arithmetic: Data Representation, Fixed Point Representation, Floating Point Representation, Addition and

More information

Topic Notes: Bits and Bytes and Numbers

Topic Notes: Bits and Bytes and Numbers Computer Science 220 Assembly Language & Comp Architecture Siena College Fall 2011 Topic Notes: Bits and Bytes and Numbers Binary Basics At least some of this will be review for most of you, but we start

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

Agenda EE 224: INTRODUCTION TO DIGITAL CIRCUITS & COMPUTER DESIGN. Lecture 1: Introduction. Go over the syllabus 3/31/2010

Agenda EE 224: INTRODUCTION TO DIGITAL CIRCUITS & COMPUTER DESIGN. Lecture 1: Introduction. Go over the syllabus 3/31/2010 // EE : INTRODUCTION TO DIGITAL CIRCUITS & COMPUTER DESIGN Lecture : Introduction /9/ Avinash Kodi, kodi@ohio.edu Agenda Go over the syllabus Introduction ti to Digital it Systems // Why Digital Systems?

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

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

Floating-point Arithmetic. where you sum up the integer to the left of the decimal point and the fraction to the right.

Floating-point Arithmetic. where you sum up the integer to the left of the decimal point and the fraction to the right. Floating-point Arithmetic Reading: pp. 312-328 Floating-Point Representation Non-scientific floating point numbers: A non-integer can be represented as: 2 4 2 3 2 2 2 1 2 0.2-1 2-2 2-3 2-4 where you sum

More information

The ALU consists of combinational logic. Processes all data in the CPU. ALL von Neuman machines have an ALU loop.

The ALU consists of combinational logic. Processes all data in the CPU. ALL von Neuman machines have an ALU loop. CS 320 Ch 10 Computer Arithmetic The ALU consists of combinational logic. Processes all data in the CPU. ALL von Neuman machines have an ALU loop. Signed integers are typically represented in sign-magnitude

More information

Number Systems Prof. Indranil Sen Gupta Dept. of Computer Science & Engg. Indian Institute of Technology Kharagpur Number Representation

Number Systems Prof. Indranil Sen Gupta Dept. of Computer Science & Engg. Indian Institute of Technology Kharagpur Number Representation Number Systems Prof. Indranil Sen Gupta Dept. of Computer Science & Engg. Indian Institute of Technology Kharagpur 1 Number Representation 2 1 Topics to be Discussed How are numeric data items actually

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

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

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

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 Systems and Computer Arithmetic

Number Systems and Computer Arithmetic Number Systems and Computer Arithmetic Counting to four billion two fingers at a time What do all those bits mean now? bits (011011011100010...01) instruction R-format I-format... integer data number text

More information

Floating point. Today! IEEE Floating Point Standard! Rounding! Floating Point Operations! Mathematical properties. Next time. !

Floating point. Today! IEEE Floating Point Standard! Rounding! Floating Point Operations! Mathematical properties. Next time. ! Floating point Today! IEEE Floating Point Standard! Rounding! Floating Point Operations! Mathematical properties Next time! The machine model Chris Riesbeck, Fall 2011 Checkpoint IEEE Floating point Floating

More information

Floating-Point Data Representation and Manipulation 198:231 Introduction to Computer Organization Lecture 3

Floating-Point Data Representation and Manipulation 198:231 Introduction to Computer Organization Lecture 3 Floating-Point Data Representation and Manipulation 198:231 Introduction to Computer Organization Instructor: Nicole Hynes nicole.hynes@rutgers.edu 1 Fixed Point Numbers Fixed point number: integer part

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

Computer Architecture and System Software Lecture 02: Overview of Computer Systems & Start of Chapter 2

Computer Architecture and System Software Lecture 02: Overview of Computer Systems & Start of Chapter 2 Computer Architecture and System Software Lecture 02: Overview of Computer Systems & Start of Chapter 2 Instructor: Rob Bergen Applied Computer Science University of Winnipeg Announcements Website is up

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

Internal Data Representation

Internal Data Representation Appendices This part consists of seven appendices, which provide a wealth of reference material. Appendix A primarily discusses the number systems and their internal representation. Appendix B gives information

More information

Divide: Paper & Pencil

Divide: Paper & Pencil Divide: Paper & Pencil 1001 Quotient Divisor 1000 1001010 Dividend -1000 10 101 1010 1000 10 Remainder See how big a number can be subtracted, creating quotient bit on each step Binary => 1 * divisor or

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

CMSC 313 COMPUTER ORGANIZATION & ASSEMBLY LANGUAGE PROGRAMMING LECTURE 02, SPRING 2013

CMSC 313 COMPUTER ORGANIZATION & ASSEMBLY LANGUAGE PROGRAMMING LECTURE 02, SPRING 2013 CMSC 313 COMPUTER ORGANIZATION & ASSEMBLY LANGUAGE PROGRAMMING LECTURE 02, SPRING 2013 TOPICS TODAY Bits of Memory Data formats for negative numbers Modulo arithmetic & two s complement Floating point

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

Foundations of Computer Systems

Foundations of Computer Systems 18-600 Foundations of Computer Systems Lecture 4: Floating Point Required Reading Assignment: Chapter 2 of CS:APP (3 rd edition) by Randy Bryant & Dave O Hallaron Assignments for This Week: Lab 1 18-600

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

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

Number Systems Standard positional representation of numbers: An unsigned number with whole and fraction portions is represented as:

Number Systems Standard positional representation of numbers: An unsigned number with whole and fraction portions is represented as: N Number Systems Standard positional representation of numbers: An unsigned number with whole and fraction portions is represented as: a n a a a The value of this number is given by: = a n Ka a a a a a

More information

Information Science 1

Information Science 1 Information Science 1 - Representa*on of Data in Memory- Week 03 College of Information Science and Engineering Ritsumeikan University Topics covered l Basic terms and concepts of The Structure of a Computer

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

IEEE Standard for Floating-Point Arithmetic: 754

IEEE Standard for Floating-Point Arithmetic: 754 IEEE Standard for Floating-Point Arithmetic: 754 G.E. Antoniou G.E. Antoniou () IEEE Standard for Floating-Point Arithmetic: 754 1 / 34 Floating Point Standard: IEEE 754 1985/2008 Established in 1985 (2008)

More information

Real Numbers finite subset real numbers floating point numbers Scientific Notation fixed point numbers

Real Numbers finite subset real numbers floating point numbers Scientific Notation fixed point numbers Real Numbers We have been studying integer arithmetic up to this point. We have discovered that a standard computer can represent a finite subset of the infinite set of integers. The range is determined

More information

CHAPTER TWO. Data Representation ( M.MORRIS MANO COMPUTER SYSTEM ARCHITECTURE THIRD EDITION ) IN THIS CHAPTER

CHAPTER TWO. Data Representation ( M.MORRIS MANO COMPUTER SYSTEM ARCHITECTURE THIRD EDITION ) IN THIS CHAPTER 1 CHAPTER TWO Data Representation ( M.MORRIS MANO COMPUTER SYSTEM ARCHITECTURE THIRD EDITION ) IN THIS CHAPTER 2-1 Data Types 2-2 Complements 2-3 Fixed-Point Representation 2-4 Floating-Point Representation

More information

System Programming CISC 360. Floating Point September 16, 2008

System Programming CISC 360. Floating Point September 16, 2008 System Programming CISC 360 Floating Point September 16, 2008 Topics IEEE Floating Point Standard Rounding Floating Point Operations Mathematical properties Powerpoint Lecture Notes for Computer Systems:

More information

CMSC 313 COMPUTER ORGANIZATION & ASSEMBLY LANGUAGE PROGRAMMING LECTURE 01, SPRING 2013

CMSC 313 COMPUTER ORGANIZATION & ASSEMBLY LANGUAGE PROGRAMMING LECTURE 01, SPRING 2013 CMSC 313 COMPUTER ORGANIZATION & ASSEMBLY LANGUAGE PROGRAMMING LECTURE 01, SPRING 2013 TOPICS TODAY Course overview Levels of machines Machine models: von Neumann & System Bus Fetch-Execute Cycle Base

More information

DRAM uses a single capacitor to store and a transistor to select. SRAM typically uses 6 transistors.

DRAM uses a single capacitor to store and a transistor to select. SRAM typically uses 6 transistors. Data Representation Data Representation Goal: Store numbers, characters, sets, database records in the computer. What we got: Circuit that stores 2 voltages, one for logic 0 (0 volts) and one for logic

More information

Representing Information. Bit Juggling. - Representing information using bits - Number representations. - Some other bits - Chapters 1 and 2.3,2.

Representing Information. Bit Juggling. - Representing information using bits - Number representations. - Some other bits - Chapters 1 and 2.3,2. Representing Information 0 1 0 Bit Juggling 1 1 - Representing information using bits - Number representations 1 - Some other bits 0 0 - Chapters 1 and 2.3,2.4 Motivations Computers Process Information

More information

UNIT 2 NUMBER SYSTEM AND PROGRAMMING LANGUAGES

UNIT 2 NUMBER SYSTEM AND PROGRAMMING LANGUAGES UNIT 2 NUMBER SYSTEM AND PROGRAMMING LANGUAGES Structure 2.0 Introduction 2.1 Unit Objectives 2.2 Number Systems 2.3 Bits and Bytes 2.4 Binary Number System 2.5 Decimal Number System 2.6 Octal Number System

More information

Number Systems. Binary Numbers. Appendix. Decimal notation represents numbers as powers of 10, for example

Number Systems. Binary Numbers. Appendix. Decimal notation represents numbers as powers of 10, for example Appendix F Number Systems Binary Numbers Decimal notation represents numbers as powers of 10, for example 1729 1 103 7 102 2 101 9 100 decimal = + + + There is no particular reason for the choice of 10,

More information

CS 101: Computer Programming and Utilization

CS 101: Computer Programming and Utilization CS 101: Computer Programming and Utilization Jul-Nov 2017 Umesh Bellur (cs101@cse.iitb.ac.in) Lecture 3: Number Representa.ons Representing Numbers Digital Circuits can store and manipulate 0 s and 1 s.

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

Bits, Words, and Integers

Bits, Words, and Integers Computer Science 52 Bits, Words, and Integers Spring Semester, 2017 In this document, we look at how bits are organized into meaningful data. In particular, we will see the details of how integers are

More information

Floating point. Today. IEEE Floating Point Standard Rounding Floating Point Operations Mathematical properties Next time.

Floating point. Today. IEEE Floating Point Standard Rounding Floating Point Operations Mathematical properties Next time. Floating point Today IEEE Floating Point Standard Rounding Floating Point Operations Mathematical properties Next time The machine model Fabián E. Bustamante, Spring 2010 IEEE Floating point Floating point

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

1. NUMBER SYSTEMS USED IN COMPUTING: THE BINARY NUMBER SYSTEM

1. NUMBER SYSTEMS USED IN COMPUTING: THE BINARY NUMBER SYSTEM 1. NUMBER SYSTEMS USED IN COMPUTING: THE BINARY NUMBER SYSTEM 1.1 Introduction Given that digital logic and memory devices are based on two electrical states (on and off), it is natural to use a number

More information

Introduction to Numbering Systems

Introduction to Numbering Systems NUMBER SYSTEM Introduction to Numbering Systems We are all familiar with the decimal number system (Base 10). Some other number systems that we will work with are Binary Base 2 Octal Base 8 Hexadecimal

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

Chapter 10 - Computer Arithmetic

Chapter 10 - Computer Arithmetic Chapter 10 - Computer Arithmetic Luis Tarrataca luis.tarrataca@gmail.com CEFET-RJ L. Tarrataca Chapter 10 - Computer Arithmetic 1 / 126 1 Motivation 2 Arithmetic and Logic Unit 3 Integer representation

More information

UNIT 7A Data Representation: Numbers and Text. Digital Data

UNIT 7A Data Representation: Numbers and Text. Digital Data UNIT 7A Data Representation: Numbers and Text 1 Digital Data 10010101011110101010110101001110 What does this binary sequence represent? It could be: an integer a floating point number text encoded with

More information

FLOATING POINT NUMBERS

FLOATING POINT NUMBERS Exponential Notation FLOATING POINT NUMBERS Englander Ch. 5 The following are equivalent representations of 1,234 123,400.0 x 10-2 12,340.0 x 10-1 1,234.0 x 10 0 123.4 x 10 1 12.34 x 10 2 1.234 x 10 3

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

The type of all data used in a C++ program must be specified

The type of all data used in a C++ program must be specified The type of all data used in a C++ program must be specified A data type is a description of the data being represented That is, a set of possible values and a set of operations on those values There are

More information

(+A) + ( B) + (A B) (B A) + (A B) ( A) + (+ B) (A B) + (B A) + (A B) (+ A) (+ B) + (A - B) (B A) + (A B) ( A) ( B) (A B) + (B A) + (A B)

(+A) + ( B) + (A B) (B A) + (A B) ( A) + (+ B) (A B) + (B A) + (A B) (+ A) (+ B) + (A - B) (B A) + (A B) ( A) ( B) (A B) + (B A) + (A B) COMPUTER ARITHMETIC 1. Addition and Subtraction of Unsigned Numbers The direct method of subtraction taught in elementary schools uses the borrowconcept. In this method we borrow a 1 from a higher significant

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

CMSC 313 COMPUTER ORGANIZATION & ASSEMBLY LANGUAGE PROGRAMMING LECTURE 02, FALL 2012

CMSC 313 COMPUTER ORGANIZATION & ASSEMBLY LANGUAGE PROGRAMMING LECTURE 02, FALL 2012 CMSC 313 COMPUTER ORGANIZATION & ASSEMBLY LANGUAGE PROGRAMMING LECTURE 02, FALL 2012 ANNOUNCEMENTS TA Office Hours (ITE 334): Genaro Hernandez, Jr. Mon 10am 12noon Roshan Ghumare Wed 10am 12noon Prof.

More information

Computer Arithmetic Ch 8

Computer Arithmetic Ch 8 Computer Arithmetic Ch 8 ALU Integer Representation Integer Arithmetic Floating-Point Representation Floating-Point Arithmetic 1 Arithmetic Logical Unit (ALU) (2) (aritmeettis-looginen yksikkö) Does all

More information

Computer Arithmetic Ch 8

Computer Arithmetic Ch 8 Computer Arithmetic Ch 8 ALU Integer Representation Integer Arithmetic Floating-Point Representation Floating-Point Arithmetic 1 Arithmetic Logical Unit (ALU) (2) Does all work in CPU (aritmeettis-looginen

More information

CMPSCI 145 MIDTERM #1 Solution Key. SPRING 2017 March 3, 2017 Professor William T. Verts

CMPSCI 145 MIDTERM #1 Solution Key. SPRING 2017 March 3, 2017 Professor William T. Verts CMPSCI 145 MIDTERM #1 Solution Key NAME SPRING 2017 March 3, 2017 PROBLEM SCORE POINTS 1 10 2 10 3 15 4 15 5 20 6 12 7 8 8 10 TOTAL 100 10 Points Examine the following diagram of two systems, one involving

More information