Presentation is loading. Please wait.

Presentation is loading. Please wait.

Chapter 1 Introduction.

Similar presentations


Presentation on theme: "Chapter 1 Introduction."— Presentation transcript:

1 Chapter 1 Introduction

2 Chapter 1 Objectives Know the difference between computer organization and computer architecture. Understand units of measure common to computer systems. Appreciate the evolution of computers. Understand the computer as a layered system. Be able to explain the von Neumann architecture and the function of basic computer components.

3 1.1 Overview Why study computer organization and architecture?
Design better programs, including system software such as compilers, operating systems, and device drivers. Optimize program behavior. Evaluate (benchmark) computer system performance. Understand time, space, and price tradeoffs.

4 1.1 Overview Computer organization Computer architecture
Encompasses all physical aspects of computer systems. E.g., circuit design, control signals, memory types. How does a computer work? Computer architecture Logical aspects of system implementation as seen by the programmer. E.g., instruction sets, instruction formats, data types, addressing modes. How do I design a computer?

5 1.2 Computer Components There is no clear distinction between matters related to computer organization and matters relevant to computer architecture. Principle of Equivalence of Hardware and Software: Anything that can be done with software can also be done with hardware, and anything that can be done with hardware can also be done with software.* * Assuming speed is not a concern.

6 1.2 Computer Components At the most basic level, a computer is a device consisting of three pieces: A processor to interpret and execute programs A memory to store both data and programs A mechanism for transferring data to and from the outside world.

7 What does it all mean?? Go to Google and search for PCI or USB port.
1.3 An Example System Consider this advertisement: MHz?? L1 Cache?? MB?? PCI?? USB?? What does it all mean?? Go to Google and search for PCI or USB port.

8 1.3 An Example System Measures of capacity and speed:
Kilo- (K) = 1 thousand = 103 and 210 Mega- (M) = 1 million = 106 and 220 Giga- (G) = 1 billion = 109 and 230 Tera- (T) = 1 trillion = 1012 and 240 Peta- (P) = 1 quadrillion = 1015 and 250 Whether a metric refers to a power of ten or a power of two typically depends upon what is being measured.

9 1.3 An Example System Hertz = clock cycles per second (frequency)
1MHz = 1,000,000Hz Processor speeds are measured in MHz or GHz. Byte = a unit of storage 1KB = 210 = 1024 Bytes 1MB = 220 = 1,048,576 Bytes Main memory (RAM) is measured in MB Disk storage is measured in GB for small systems, TB for large systems.

10 1.3 An Example System Measures of time and space:
Milli- (m) = 1 thousandth = 10 -3 Micro- () = 1 millionth = 10 -6 Nano- (n) = 1 billionth = 10 -9 Pico- (p) = 1 trillionth = Femto- (f) = 1 quadrillionth =

11 1.3 An Example System Millisecond = 1 thousandth of a second
Hard disk drive access times are often 10 to 20 milliseconds. Nanosecond = 1 billionth of a second Main memory access times are often 50 to 70 nanoseconds. Micron (micrometer) = 1 millionth of a meter Circuits on computer chips are measured in microns.

12 1.3 An Example System 133,000,000 cycles/second = 7.52ns/cycle
We note that cycle time is the reciprocal of clock frequency. A bus operating at 133MHz has a cycle time of 7.52 nanoseconds: 133,000,000 cycles/second = 7.52ns/cycle 1/ = 7.52 × 10-9 Now back to the advertisement ...

13 1.3 An Example System The microprocessor is the “brain” of the system. It executes program instructions. This one is a Pentium III (Intel) running at 667MHz. A system bus moves data within the computer. The faster the bus the better. This one runs at 133MHz.

14 1.3 An Example System Computers with large main memory capacity can run larger programs with greater speed than computers having small memories. RAM is an acronym for random access memory. Random access means that memory contents can be accessed directly if you know its location. Cache is a type of temporary memory that can be accessed faster than RAM.

15 1.3 An Example System This system has 64MB of (fast) synchronous dynamic RAM (SDRAM) . . . Google search for SDRAM? … and two levels of cache memory, the level 1 (L1) cache is smaller and (probably) faster than the L2 cache. Note that these cache sizes are measured in KB.

16 1.3 An Example System Hard disk capacity determines the amount of data and size of programs you can store. This one can store 30GB RPM is the rotational speed of the disk. Generally, the faster a disk rotates, the faster it can deliver data to RAM. (There are many other factors involved.)

17 1.3 An Example System EIDE stands for enhanced integrated drive electronics, which describes how the hard disk interfaces with (or connects to) other system components. A CD-ROM can store about 650MB of data, making it an ideal medium for distribution of commercial software packages. 48x describes its speed.

18 1.3 An Example System Ports allow movement of data between a system and its external devices. This system has four ports.

19 1.3 An Example System Serial ports send data as a series of pulses along one or two data lines. Parallel ports send data as a single pulse along at least eight data lines. USB, universal serial bus, is an intelligent serial interface that is self-configuring. (It supports “plug and play.”)

20 1.3 An Example System System buses can be augmented by dedicated I/O buses. PCI, peripheral component interface, is one such bus. This system has two PCI devices: a sound card, and a modem for connecting to the Internet.

21 1.3 An Example System The number of times per second that the image on the monitor is repainted is its refresh rate. The dot pitch of a monitor tells us how clear the image is. This monitor has a dot pitch of 0.24mm and a refresh rate of 85Hz. The graphics card contains memory and programs that support the monitor. Google search for AGP?

22 A Look Inside a Computer (p7-p8)
1.3 An Example System Throughout the remainder of this book you will see how these components work and how they interact with software to make complete computer systems. This statement raises two important questions: What assurance do we have that computer components will operate as we expect? And what assurance do we have that computer components will operate together? A Look Inside a Computer (p7-p8)

23 1.4 Standards Organizations
There are many organizations that set computer hardware standards-- to include the interoperability of computer components. Throughout this book, and in your career, you will encounter many of them. Some of the most important standards-setting groups are . . .

24 1.4 Standards Organizations
The Institute of Electrical and Electronic Engineers (IEEE) Promotes the interests of the worldwide electrical engineering community. Establishes standards for computer components, data representation, and signaling protocols, among many other things.

25 1.4 Standards Organizations
The International Telecommunications Union (ITU) Concerns itself with the interoperability of telecommunications systems, including data communications and telephony. National groups establish standards within their respective countries: The American National Standards Institute (ANSI) The British Standards Institution (BSI)

26 1.4 Standards Organizations
The International Organization for Standardization (ISO) Establishes worldwide standards for everything from screw threads to photographic film. Is influential in formulating standards for computer hardware and software, including their methods of manufacture. Note: ISO is not an acronym. ISO comes from the Greek, isos, meaning “equal.”

27 1.5 Historical Development
To fully appreciate the computers of today, it is helpful to understand how things got the way they are. The evolution of computing machinery has taken place over several centuries. In modern times computer evolution is usually classified into four generations according to the salient technology of the era. We note that many of the following dates are approximate.

28 1.5 Historical Development
Generation Zero: Mechanical Calculating Machines ( ) Calculating Clock - Wilhelm Schickard ( ). Pascaline - Blaise Pascal ( ). Difference Engine - Charles Babbage ( ), also designed but never built the Analytical Engine. Punched card tabulating machines - Herman Hollerith ( ). Hollerith cards were commonly used for computer input well into the 1970s.

29 1.5 Historical Development
The First Generation: Vacuum Tube Computers ( ) Atanasoff Berry Computer ( ) solved systems of linear equations. John Atanasoff and Clifford Berry of Iowa State University. Refer to pp17-18

30 1.5 Historical Development
The First Generation: Vacuum Tube Computers ( ) Electronic Numerical Integrator and Computer (ENIAC) John Mauchly and J. Presper Eckert University of Pennsylvania, 1946 The first general-purpose computer. The Army’s ENIAC, 1946 (page16)

31 1.5 Historical Development
The First Generation: Vacuum Tube Computers ( ) IBM 650 (1955) Phased out in 1969. The first mass-produced computer.

32 1.5 Historical Development
The Second Generation: Transistorized Computers ( ) IBM 7094 (scientific) and 1401 (business) Digital Equipment Corporation (DEC) PDP-1 Univac 1100 . . . and many others. Refer to pp19-21. DEC PDP-1

33 1.5 Historical Development
The Third Generation: Integrated Circuit Computers ( ) IBM 360 DEC PDP-8 and PDP-11 Cray-1 supercomputer . . . and many others. IBM 360 Cray-1

34 1.5 Historical Development
The Fourth Generation: VLSI Computers ( ????) Very large scale integrated circuits (VLSI) have more than 10,000 components per chip. Enabled the creation of microprocessors. The first was the 4-bit Intel 4004. Later versions, such as the 8080, 8086, and 8088 spawned the idea of “personal computing.” Refer to page22 Intel 4004

35 1.5 Historical Development
Moore’s Law (1965) Gordon Moore, Intel founder “The density of transistors in an integrated circuit will double every year.” Contemporary version: “The density of silicon chips doubles every 18 months.” But this “law” cannot hold forever ...

36 1.5 Historical Development
Rock’s Law Arthur Rock, Intel financier “The cost of capital equipment to build semiconductors will double every four years.” In 1968, a new chip plant cost about $12,000. At the time, $12,000 would buy a nice home in the suburbs. An executive earning $12,000 per year was “making a very comfortable living.”

37 1.5 Historical Development
Rock’s Law In 2003, a chip plants under construction will cost over $2.5 billion. For Moore’s Law to hold, Rock’s Law must fall, or vice versa. But no one can say which will give out first. $2.5 billion is more than the gross domestic product of some small countries, including Belize, Bhutan, and the Republic of Sierra Leone.

38 1.6 The Computer Level Hierarchy
Computers consist of many things besides chips. Before a computer can do anything worthwhile, it must also use software. Writing complex programs requires a “divide and conquer” approach, where each program module solves a smaller problem. Complex computer systems employ a similar technique through a series of virtual machine layers.

39 1.6 The Computer Level Hierarchy
Each virtual machine layer is an abstraction of the level below it. The machines at each level execute their own particular instructions, calling upon machines at lower levels to perform tasks as required. Computer circuits ultimately carry out the work.

40 1.6 The Computer Level Hierarchy
Level 6: The User Level Program execution and user interface level. The level with which we are most familiar. Level 5: High-Level Language Level The level with which we interact when we write programs in languages such as C, Pascal, Lisp, and Java.

41 1.6 The Computer Level Hierarchy
Level 4: Assembly Language Level Acts upon assembly language produced from Level 5, as well as instructions programmed directly at this level. Level 3: System Software Level Controls executing processes on the system. Protects system resources. Assembly language instructions often pass through Level 3 without modification.

42 1.6 The Computer Level Hierarchy
Level 2: Machine Level Also known as the Instruction Set Architecture (ISA) Level. Consists of instructions that are particular to the architecture of the machine. Programs written in machine language need no compilers, interpreters, or assemblers.

43 1.6 The Computer Level Hierarchy
Level 1: Control Level A control unit decodes and executes instructions and moves data through the system. Control units can be microprogrammed or hardwired. A microprogram is a program written in a low-level language that is implemented by the hardware. Hardwired control units consist of hardware that directly executes machine instructions.

44 1.6 The Computer Level Hierarchy
Level 0: Digital Logic Level This level is where we find digital circuits (the chips). Digital circuits consist of gates and wires. These components implement the mathematical and control logic of all other levels.

45 1.7 The von Neumann Model On the ENIAC ( ), all programming was done at the digital logic level. Programming the computer involved moving plugs and wires.

46 1.7 The von Neumann Model Inventors of the ENIAC, John Mauchley and J. Presper Eckert, conceived of a computer that could store instructions in memory. The invention of this idea has since been ascribed to a mathematician, John von Neumann, who was a contemporary of Mauchley and Eckert. Stored-program computers have become known as von Neumann Architecture systems.

47 1.7 The von Neumann Model Today’s stored-program computers have the following characteristics: Three hardware systems: A central processing unit (CPU) A main memory system An I/O system The capacity to carry out sequential instruction processing. A single data path between the CPU and main memory. This single path is known as the von Neumann bottleneck.

48 1.7 The von Neumann Model This is a general depiction of a von Neumann system: These computers employ a fetch-decode-execute cycle to run programs as follows . . .

49 1.7 The von Neumann Model The control unit fetches the next instruction from memory using the program counter to determine where the instruction is located.

50 1.7 The von Neumann Model The instruction is decoded into a language that the ALU can understand.

51 1.7 The von Neumann Model Any data operands required to execute the instruction are fetched from memory and placed into registers within the CPU.

52 1.7 The von Neumann Model The ALU executes the instruction and places results in registers or memory.

53 The Modified von Neumann Architecture (adding a system bus)

54 1.8 Non-von Neumann Models
Conventional stored-program computers have undergone many incremental improvements over the years. These improvements include adding specialized buses, floating-point units, and cache memories, to name only a few. But enormous improvements in computational power require departure from the classic von Neumann architecture. Adding processors is one approach.

55 1.8 Non-von Neumann Models
In the late 1960s, high-performance computer systems were equipped with dual processors to increase computational throughput. In the 1970s supercomputer systems were introduced with 32 processors. Supercomputers with 1,000 processors were built in the 1980s. In 1999, IBM announced its Blue Gene system containing over 1 million processors.

56 1.8 Non-von Neumann Models
Parallel processing is only one method of providing increased computational power. More radical systems have reinvented the fundamental concepts of computation. These advanced systems include genetic computers, quantum computers, and dataflow systems. At this point, it is unclear whether any of these systems will provide the basis for the next generation of computers.

57 Conclusion This chapter has given you an overview of the subject of computer architecture. You should now be sufficiently familiar with general system structure to guide your studies throughout the remainder of this course. Subsequent chapters will explore many of these topics in great detail.

58 Chapter 1 Homework Due: 9/8/2010 Pages: 34-35 Exercises: 2, 4, 8, 9.

59 Data Representation in Computer Systems
Chapter 2 Data Representation in Computer Systems

60 Chapter 2 Objectives Understand the fundamentals of numerical data representation and manipulation in digital computers. Master the skill of converting between various radix systems. Understand how errors can occur in computations because of overflow and truncation.

61 Chapter 2 Objectives Gain familiarity with the most popular character codes. Become aware of the differences between how data is stored in computer memory, how it is transmitted over telecommunication lines, and how it is stored on disks. Understand the concepts of error detecting and correcting codes.

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

63 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. In a word-addressable system, a word is the smallest addressable unit of storage. A group of four bits is called a nibble (or nybble). Bytes, therefore, consist of two nibbles: a “high-order nibble,” and a “low-order” nibble.

64 2.2 Positional Numbering Systems
Bytes store numbers when the position of each bit represents 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).

65 2.2 Positional Numbering Systems
The decimal number 947 in powers of 10 is: The decimal number in powers of 10 is: 9    10 0 5     10 0 + 4   10 -2

66 2.2 Positional Numbering Systems
The binary number in powers of 2 is: 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: = 2510 1      2 0 = = 25

67 2.3 Decimal to Binary Conversions
Because binary numbers are the basis for all data representation in digital computer systems, it is important that you become proficient with this radix system. Your knowledge of the binary numbering system will enable you to understand the operation of all computer components as well as the design of instruction set architectures.

68 2.3 Decimal to Binary Conversions
In a previous slide, we said that every integer value can be represented exactly using any radix system. You can use either of two methods for radix conversion: the subtraction method and the division remainder method. The subtraction method is more intuitive, but cumbersome. It does, however reinforce the ideas behind radix mathematics.

69 2.3 Decimal to Binary Conversions
Suppose we want to convert the decimal number 190 to base 3. We know that 3 5 = 243 so our result will be less than six digits wide. The largest power of 3 that we need is therefore 3 4 = 81, and  2 = 162. Write down the 2 and subtract 162 from 190, giving 28.

70 2.3 Decimal to Binary Conversions
Converting 190 to base 3... The next power of 3 is = 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.

71 2.3 Decimal to Binary Conversions
Converting 190 to base 3... 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: 19010 =

72 2.3 Decimal to Binary Conversions
Another method of converting integers from decimal to some other radix uses division. This method is mechanical and easy. It employs the idea that successive division by a base is equivalent to successive subtraction by powers of the base. Let’s use the division remainder method to again convert 190 in decimal to base 3.

73 2.3 Decimal to Binary Conversions
Converting 190 to base 3... First we take the number that we wish to convert and divide it by the radix in which we want to express our result. In this case, 3 divides times, with a remainder of 1. Record the quotient and the remainder.

74 2.3 Decimal to Binary Conversions
Converting 190 to base 3... 63 is evenly divisible by 3. Our remainder is zero, and the quotient is 21.

75 2.3 Decimal to Binary Conversions
Converting 190 to base 3... Continue in this way until the quotient is zero. In the final calculation, we note that 3 divides 2 zero times with a remainder of 2. Our result, reading from bottom to top is: 19010 =

76 2.3 Decimal to Binary Conversions
Fractional values can be approximated in all base systems. Unlike integer values, fractions do not necessarily have exact representations under all radices. The quantity ½ is exactly representable in the binary and decimal systems, but is not in the ternary (base 3) numbering system.

77 2.3 Decimal to Binary Conversions
Fractional decimal values have nonzero digits to the right of the decimal point. Fractional values of other radix systems have nonzero digits to the right of the radix point. Numerals to the right of a radix point represent negative powers of the radix: = 4   10 -2 = 1   2 -2 = ½ ¼ = = 0.75

78 2.3 Decimal to Binary Conversions
As with whole-number conversions, you can use either of two methods: a subtraction method and an easy multiplication method. The subtraction method for fractions is identical to the subtraction method for whole numbers. Instead of subtracting positive powers of the target radix, we subtract negative powers of the radix. We always start with the largest value first, n -1, where n is our radix, and work our way along using larger negative exponents.

79 2.3 Decimal to Binary Conversions
The calculation to the right is an example of using the subtraction method to convert the decimal to binary. Our result, reading from top to bottom is: = Of course, this method works with any base, not just binary.

80 2.3 Decimal to Binary Conversions
Using the multiplication method to convert the decimal to binary, we multiply by the radix 2. The first product carries into the units place.

81 2.3 Decimal to Binary Conversions
Converting to binary . . . Ignoring the value in the units place at each step, continue multiplying each fractional part by the radix.

82 2.3 Decimal to Binary Conversions
Converting to binary . . . You are finished when the product is zero, or until you have reached the desired number of binary places. Our result, reading from top to bottom is: = This method also works with any base. Just use the target radix as the multiplier.

83 2.3 Decimal to Binary Conversions
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: = For compactness and ease of reading, binary values are usually expressed using the hexadecimal, or base-16, numbering system.

84 2.3 Decimal to Binary Conversions
The hexadecimal numbering system uses the numerals 0 through 9 and the letters A through F. The decimal number 12 is B16. The decimal number 26 is 1A16. It is easy to convert between base 16 and base 2, because 16 = 24. Thus, to convert from binary to hexadecimal, all we need to do is group the binary digits into groups of four. A group of four binary digits is called a hextet

85 2.3 Decimal to Binary Conversions
Using groups of hextets, the binary number (= ) in hexadecimal is: Octal (base 8) values are derived from binary by using groups of three bits (8 = 23): Octal was very useful when computers used six-bit words.

86 2.4 Signed Integer Representation
The conversions we have so far presented have involved only positive numbers. To represent negative values, computer systems allocate the high-order bit to indicate the sign of a value. The high-order bit is the leftmost bit in a byte. It is also called the most significant bit. The remaining bits contain the value of the number.

87 2.4 Signed Integer Representation
There are three ways in which signed binary numbers may be expressed: Signed magnitude, One’s complement and Two’s complement. In an 8-bit word, signed magnitude representation places the absolute value of the number in the 7 bits to the right of the sign bit.

88 2.4 Signed Integer Representation
For example, in 8-bit signed magnitude, positive 3 is: Negative 3 is: Computers perform arithmetic operations on signed magnitude numbers in much the same way as humans carry out pencil and paper arithmetic. Humans often ignore the signs of the operands while performing a calculation, applying the appropriate sign after the calculation is complete.

89 2.4 Signed Integer Representation
Binary addition is as easy as it gets. You need to know only four rules: 0 + 0 = = 1 1 + 0 = = 10 The simplicity of this system makes it possible for digital circuits to carry out arithmetic operations. We will describe these circuits in Chapter 3. Let’s see how the addition rules work with signed magnitude numbers . . .

90 2.4 Signed Integer Representation
Example: Using signed magnitude binary arithmetic, find the sum of 75 and 46. First, convert 75 and 46 to binary, and arrange as a sum, but separate the (positive) sign bits from the magnitude bits.

91 2.4 Signed Integer Representation
Example: Using signed magnitude binary arithmetic, find the sum of 75 and 46. Just as in decimal arithmetic, we find the sum starting with the rightmost bit and work left.

92 2.4 Signed Integer Representation
Example: Using signed magnitude binary arithmetic, find the sum of 75 and 46. In the second bit, we have a carry, so we note it above the third bit.

93 2.4 Signed Integer Representation
Example: Using signed magnitude binary arithmetic, find the sum of 75 and 46. The third and fourth bits also give us carries.

94 2.4 Signed Integer Representation
Example: Using signed magnitude binary arithmetic, find the sum of 75 and 46. Once we have worked our way through all eight bits, we are done. In this example, we were careful to pick two values whose sum would fit into seven bits. If that is not the case, we have a problem.

95 2.4 Signed Integer Representation
Example: Using signed magnitude binary arithmetic, find the sum of 107 and 46. We see that the carry from the seventh bit overflows and is discarded, giving us the erroneous result: = 25.

96 2.4 Signed Integer Representation
The signs in signed magnitude representation work just like the signs in pencil and paper arithmetic. Example: Using signed magnitude binary arithmetic, find the sum of - 46 and - 25. Because the signs are the same, all we do is add the numbers and supply the negative sign when we are done.

97 2.4 Signed Integer Representation
Mixed sign addition (or subtraction) is done the same way. Example: Using signed magnitude binary arithmetic, find the sum of 46 and - 25. The sign of the result gets the sign of the number that is larger. Note the “borrows” from the second and sixth bits.

98 2.4 Signed Integer Representation
Signed magnitude representation is easy for people to understand, but it requires complicated computer hardware. Another disadvantage of signed magnitude is that it allows two different representations for zero: positive zero ( ) and negative zero ( ). Mathematically speaking, positive 0 and negative 0 simply shouldn’t happen. For these reasons (among others) computers systems employ complement systems for numeric value representation.

99 2.4 Signed Integer Representation
In complement systems, negative values are represented by some difference between a number and its base. In diminished radix complement systems, a negative value is given by the difference between the absolute value of a number and one less than its base. In the binary system, this gives us one’s complement. It amounts to little more than flipping the bits of a binary number.

100 2.4 Signed Integer Representation
For example, in 8-bit one’s complement, positive 3 is: Negative 3 is: In one’s complement, as with signed magnitude, negative values are indicated by a 1 in the high order bit. Complement systems are useful because they eliminate the need for special circuitry for subtraction. The difference of two values is found by adding the minuend to the complement of the subtrahend.

101 2.4 Signed Integer Representation
With one’s complement addition, the carry bit is “carried around” and added to the sum. Example: Using one’s complement binary arithmetic, find the sum of 48 and - 19 We note that 19 in one’s complement is so -19 in one’s complement is:

102 2.4 Signed Integer Representation
Although the “end carry around” adds some complexity, one’s complement is simpler to implement than signed magnitude. But it still has the disadvantage of having two different representations for zero: positive zero ( ) and negative zero ( ). Two’s complement solves this problem. Two’s complement is the radix complement of the binary numbering system.

103 2.4 Signed Integer Representation
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. Example: In 8-bit one’s complement, positive 3 is: Negative 3 in one’s complement is: Adding 1 gives us -3 in two’s complement form:

104 2.4 Signed Integer Representation
With two’s complement arithmetic, all we do is add our two binary numbers. Just discard any carries emitting from the high order bit. Example: Using one’s complement binary arithmetic, find the sum of 48 and - 19. We note that 19 in one’s complement is: , so -19 in one’s complement is: , and -19 in two’s complement is:

105 2.4 Signed Integer Representation
When we use any finite number of bits to represent a number, we always run the risk of the result of our calculations becoming too large to be stored in the computer. While we can’t always prevent overflow, we can always detect overflow. In complement arithmetic, an overflow condition is easy to detect.

106 2.4 Signed Integer Representation
Example: Using two’s complement binary arithmetic, 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: = -103. Rule for detecting two’s complement overflow: When the “carry into” the sign bit is different from the “carry out” of the sign bit, overflow has occurred.

107 2.5 Floating-Point Representation
The signed magnitude, one’s complement, and two’s complement representation that we have just presented deal with integer values only. Without modification, these formats are not useful in scientific or business applications that deal with real number values. Floating-point representation solves this problem.

108 2.5 Floating-Point Representation
If we are clever programmers, we can perform floating-point calculations using any integer format. This is called floating-point emulation, because floating point values aren’t stored as such, we just create programs that make it seem as if floating-point values are being used. Most of today’s computers are equipped with specialized hardware that performs floating-point arithmetic with no special programming required.

109 2.5 Floating-Point Representation
Floating-point numbers allow an arbitrary number of decimal places to the right of the decimal point. For example: 0.5  0.25 = 0.125 They are often expressed in scientific notation. For example: 0.125 = 1.25  10-1 5,000,000 = 5.0  106

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

111 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. Figure 2.2 floating-point representation (p56)

112 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 (mantissa) determines the precision of the representation.

113 2.5 Floating-Point Representation
The IEEE-754 single precision floating point standard uses an 8-bit exponent and a 23-bit significand. The IEEE-754 double precision standard uses an 11-bit exponent and a 52-bit significand. For illustrative purposes, we will use a 14-bit model (single precision) with a 5-bit exponent and an 8-bit significand.

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

115 2.5 Floating-Point Representation
Example: Express 3210 in the simplified 14-bit floating-point model. We know that 32 is 25. So in (binary) scientific notation 32 = 1.0 x 25 = 0.1 x 26. Using this information, we put 110 (= 610) in the exponent field and 1 in the significand as shown.

116 2.5 Floating-Point Representation
The illustrations shown at the right are all equivalent representations for 32 using our simplified model. Not only do these synonymous representations waste space, but they can also cause confusion.

117 2.5 Floating-Point Representation
Another problem with our system is that we have made no allowances for negative exponents. We have no way to express 0.5 (=2 -1)! (Notice that there is no sign in the exponent field!) All of these problems can be fixed with no changes to our basic model.

118 2.5 Floating-Point Representation
To resolve the problem of synonymous forms, we will establish a rule that the first digit of the significand must be 1. This results in a unique pattern for each floating-point number. In the IEEE-754 standard, this 1 is implied meaning that a 1 is assumed after the binary point. By using an implied 1, we increase the precision of the representation by a power of two. (Why?) In our simple instructional model, we will use no implied bits.

119 2.5 Floating-Point Representation
To provide for negative exponents, we will 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 will use 16 for our bias. This is called excess-16 representation. In our model, exponent values less than 16 are negative, representing fractional numbers.

120 2.5 Floating-Point Representation
Example: Express 3210 in the revised 14-bit floating-point model. We know that 32 = 1.0 x 25 = 0.1 x 26. To use our excess 16 biased exponent, we add 16 to 6, giving 2210 (=101102). Graphically:

121 2.5 Floating-Point Representation
Example: Express in the revised 14-bit floating-point model. We know that is So in (binary) scientific notation = 1.0 x 2-4 = 0.1 x 2 -3. To use our excess 16 biased exponent, we add 16 to -3, giving 1310 (=011012).

122 2.5 Floating-Point Representation
Example: Express in the revised 14-bit floating-point model. We find = Normalizing, we have: = x 2 5. To use our excess 16 biased exponent, we add 16 to 5, giving 2110 (=101012). We also need a 1 in the sign bit (for a negative number).

123 2.5 Floating-Point Representation
The IEEE-754 single precision floating point standard uses bias of 127 over its 8-bit exponent. An exponent of 255 indicates a special value. If the significand is zero, the value is  infinity. If the significand is nonzero, the value is NaN, “not a number,” often used to flag an error condition. The double precision standard has a bias of 1023 over its 11-bit exponent. The “special” exponent value for a double precision number is 2047, instead of the 255 used by the single precision standard.

124 Figure 2.4 Range of IEEE-754 Double-Precision Numbers

125 2.5 Floating-Point Representation
Both the 14-bit model that we have presented and the IEEE-754 floating point standard allow two representations for zero. Zero is indicated by all zeros in the exponent and the significand, but the sign bit can be either 0 or 1. This is why programmers should avoid testing a floating-point value for equality to zero. Negative zero does not equal positive zero.

126 2.5 Floating-Point Representation
Floating-point addition and subtraction are done using methods analogous to how we perform calculations using pencil and paper. The first thing that we do is express both operands in the same exponential power, then add the numbers, preserving the exponent in the sum. If the exponent requires adjustment, we do so at the end of the calculation.

127 2.5 Floating-Point Representation
Example: Find the sum of 1210 and using the 14-bit floating-point model. We find 1210 = x And = x 2 1 = x 2 4. Thus, our sum is x 2 4.

128 2.5 Floating-Point Representation
Floating-point multiplication is also carried out in a manner akin to how we perform multiplication using pencil and paper. We multiply the two operands and add their exponents. If the exponent requires adjustment, we do so at the end of the calculation.

129 2.5 Floating-Point Representation
Example: Find the product of 1210 and using the 14-bit floating-point model. We find 1210 = x And = x 2 1. Thus, our product is x 2 5 = x 2 4. The normalized product requires an exponent of 2010 =

130 2.5 Floating-Point Representation
No matter how many bits we use in a floating-point representation, our model must be finite. The real number system is, of course, infinite, so our models can give nothing more than an approximation of a real value. At some point, every model breaks down, introducing errors into our calculations. By using a greater number of bits in our model, we can reduce these errors, but we can never totally eliminate them.

131 2.5 Floating-Point Representation
Our job becomes one of reducing error, or at least being aware of the possible magnitude of error in our calculations. We must also be aware that errors can compound through repetitive arithmetic operations. For example, our 14-bit model cannot exactly represent the decimal value In binary, it is 9 bits wide: =

132 2.5 Floating-Point Representation
When we try to express in our 14-bit model, we lose the low-order bit, giving a relative error of: If we had a procedure that repetitively added 0.5 to 128.5, we would have an error of nearly 2% after only four iterations. 128  0.39%

133 2.5 Floating-Point Representation
Floating-point errors can be reduced when we use operands that are similar in magnitude. If we were repetitively adding 0.5 to 128.5, it would have been better to iteratively add 0.5 to itself and then add to this sum. In this example, the error was caused by loss of the low-order bit. Loss of the high-order bit is more problematic.

134 2.5 Floating-Point Representation
Floating-point 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. Experienced programmers know that it’s better for a program to crash than to have it produce incorrect, but plausible, results.

135 2.6 Character Codes Calculations aren’t useful until their results can be displayed in a manner that is meaningful to people. We also need to store the results of calculations, and provide a means for data input. Thus, human-understandable characters must be converted to computer-understandable bit patterns using some sort of character encoding scheme.

136 2.6 Character Codes As computers have evolved, character codes have evolved. Larger computer memories and storage devices permit richer character codes. The earliest computer coding systems used six bits. Binary-coded decimal (BCD) was one of these early codes. It was used by IBM mainframes in the 1950s and 1960s.

137 Fig. 2.5 Binary-Coded Decimal

138 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 by IBM mainframes today.

139 2.6 Character Codes 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, ASCII was the dominant character code outside the IBM mainframe world.

140 Fig. 2.7 The ASCII Code

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

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

143 2.7 Codes for Data Recording And Transmission
When character codes or numeric values are stored in computer memory, their values are unambiguous. This is not always the case when data is stored on magnetic disk or transmitted over a distance of more than a few feet. Owing to the physical irregularities of data storage and transmission media, bytes can become garbled. Data errors are reduced by use of suitable coding methods as well as through the use of various error-detection techniques.

144 2.7 Codes for Data Recording And Transmission
To transmit data, pulses of “high” and “low” voltage are sent across communications media. To store data, changes are induced in the magnetic polarity of the recording medium. These polarity changes are called flux reversals. The period of time during which a bit is transmitted, or the area of magnetic storage within which a bit is stored is called a bit cell.

145 2.7 Codes for Data Recording And Transmission
The simplest data recording and transmission code is the non-return-to-zero (NRZ) code. NRZ encodes 1 as “high” and 0 as “low.” The coding of OK (in ASCII) is shown below.

146 2.7 Codes for Data Recording And Transmission
The problem with NRZ code is that long strings of zeros and ones cause synchronization loss. Non-return-to-zero-invert (NRZI) reduces this synchronization loss by providing a transition (either low-to-high or high-to-low) for each binary 1.

147 2.7 Codes for Data Recording And Transmission
Although it prevents loss of synchronization over long strings of binary ones, NRZI coding does nothing to prevent synchronization loss within long strings of zeros. Manchester coding (also known as phase modulation) prevents this problem by encoding a binary one with an “up” transition and a binary zero with a “down” transition.

148 2.7 Codes for Data Recording And Transmission
For many years, Manchester code was the dominant transmission code for local area networks. It is, however, wasteful of communications capacity because there is a transition on every bit cell. A more efficient coding method is based upon the frequency modulation (FM) code. In FM, a transition is provided at each cell boundary. Cells containing binary ones have a mid-cell transition.

149 2.7 Codes for Data Recording And Transmission
At first glance, FM is worse than Manchester code, because it requires a transition at each cell boundary. If we can eliminate some of these transitions, we would have a more economical code. Modified FM does just this. It provides a cell boundary transition only when adjacent cells contain zeros. An MFM cell containing a binary one has a transition in the middle as in regular FM.

150 2.7 Codes for Data Recording And Transmission
The main challenge for data recording and trans-mission is how to retain synchronization without chewing up more resources than necessary. Run-length-limited, RLL, is a code specifically designed to reduce the number of consecutive ones and zeros. Some extra bits are inserted into the code. But even with these extra bits RLL is remarkably efficient.

151 2.7 Codes for Data Recording And Transmission
An RLL(d,k) code dictates a minimum of d and a maximum of k consecutive zeros between any pair of consecutive ones. RLL(2,7) has been the dominant disk storage coding method for many years. An RLL(2,7) code contains more bit cells than its corresponding ASCII or EBCDIC character. However, the coding method allows bit cells to be smaller, thus closer together, than in MFM or any other code.

152 Fig RLL(2,7) Coding

153 2.7 Codes for Data Recording And Transmission
The RLL(2,7) coding for OK is shown below, compared to MFM. The RLL code (bottom) contains 25% fewer transitions than the MFM code (top). The details as to how this code is derived are given in the text.

154 2.8 Error Detection and Correction
It is physically impossible for any data recording or transmission medium to be 100% perfect 100% of the time over its entire expected useful life. As more bits are packed onto a square centimeter of disk storage, as communications transmission speeds increase, the likelihood of error increases-- sometimes geometrically. Thus, error detection and correction is critical to accurate data transmission, storage and retrieval.

155 2.8 Error Detection and Correction
Check digits, appended to the end of a long number can provide some protection against data input errors. The last character of UPC barcodes and ISBNs are check digits. Longer data streams require more economical and sophisticated error detection mechanisms. Cyclic redundancy checking (CRC) codes provide error detection for large blocks of data.

156 2.8 Error Detection and Correction
Checksums and CRCs are examples of systematic error detection. In systematic error detection a group of error control bits is appended to the end of the block of transmitted data. This group of bits is called a syndrome. CRCs are polynomials over the modulo 2 arithmetic field. The mathematical theory behind modulo 2 polynomials is beyond our scope. However, we can easily work with it without knowing its theoretical underpinnings.

157 2.8 Error Detection and Correction
Modulo 2 arithmetic works like clock arithmetic. In clock arithmetic, if we add 2 hours to 11:00, we get 1:00. In modulo 2 arithmetic if we add 1 to 1, we get 0. The addition rules couldn’t be simpler: 0 + 0 = = 1 1 + 0 = = 0 You will fully understand why modulo 2 arithmetic is so handy after you study digital circuits in Chapter 3.

158 2.8 Error Detection and Correction
Find the quotient and remainder when is divided by 1101 in modulo 2 arithmetic. As with traditional division, we note that the dividend is divisible once by the divisor. We place the divisor under the dividend and perform modulo 2 subtraction.

159 2.8 Error Detection and Correction
Find the quotient and remainder when is divided by 1101 in modulo 2 arithmetic… Now we bring down the next bit of the dividend. We see that is not divisible by So we place a zero in the quotient.

160 2.8 Error Detection and Correction
Find the quotient and remainder when is divided by 1101 in modulo 2 arithmetic… 1010 is divisible by 1101 in modulo 2. We perform the modulo 2 subtraction.

161 2.8 Error Detection and Correction
Find the quotient and remainder when is divided by 1101 in modulo 2 arithmetic… We find the quotient is 1011, and the remainder is 0010. This procedure is very useful to us in calculating CRC syndromes. Note: The divisor in this example corresponds to a modulo 2 polynomial: X 3 + X

162 2.8 Error Detection and Correction
Suppose we want to transmit the information string: The receiver and sender decide to use the (arbitrary) polynomial pattern, 1101. The information string is shifted left by one position less than the number of positions in the divisor. The remainder is found through modulo 2 division (at right) and added to the information string: =

163 2.8 Error Detection and Correction
If no bits are lost or corrupted, dividing the received information string by the agreed upon pattern will give a remainder of zero. We see this is so in the calculation at the right. Real applications use longer polynomials to cover larger information strings. Some of the standard poly-nomials are listed in the text.

164 2.8 Error Detection and Correction
Data transmission errors are easy to fix once an error is detected. Just ask the sender to transmit the data again. In computer memory and data storage, however, this cannot be done. Too often the only copy of something important is in memory or on disk. Thus, to provide data integrity over the long term, error correcting codes are required.

165 2.8 Error Detection and Correction
Hamming codes and Reed-Soloman codes are two important error correcting codes. Reed-Soloman codes are particularly useful in correcting burst errors that occur when a series of adjacent bits are damaged. Because CD-ROMs are easily scratched, they employ a type of Reed-Soloman error correction. Because the mathematics of Hamming codes is much simpler than Reed-Soloman, we discuss Hamming codes in detail.

166 2.8 Error Detection and Correction
Hamming codes are code words formed by adding redundant check bits, or parity bits, to a data word. The Hamming distance between two code words is the number of bits in which two code words differ. The minimum Hamming distance for a code is the smallest Hamming distance between all pairs of words in the code. This pair of bytes has a Hamming distance of 3:

167 2.8 Error Detection and Correction
The minimum Hamming distance for a code, D(min), determines its error detecting and error correcting capability. For any code word, X, to be interpreted as a different valid code word, Y, at least D(min) single-bit errors must occur in X. Thus, to detect k (or fewer) single-bit errors, the code must have a Hamming distance of D(min) = k + 1.

168 2.8 Error Detection and Correction
Hamming codes can detect D(min) - 1 errors and correct errors Thus, a Hamming distance of 2k + 1 is required to be able to correct k errors in any data word. Hamming distance is provided by adding a suitable number of parity bits to a data word.

169 2.8 Error Detection and Correction
Suppose we have a set of n-bit code words consisting of m data bits and r (redundant) parity bits. An error could occur in any of the n bits, so each code word can be associated with n erroneous words at a Hamming distance of 1. Therefore,we have n + 1 bit patterns for each code word: one valid code word, and n erroneous words.

170 2.8 Error Detection and Correction
With n-bit code words, we have 2 n possible code words consisting of 2 m data bits (where m = n + r). This gives us the inequality: (n + 1)  2 m  2 n Because m = n + r, we can rewrite the inequality as: (m + r + 1)  2 m  2 m + r or (m + r + 1)  2 r This inequality gives us a lower limit on the number of check bits that we need in our code words.

171 2.8 Error Detection and Correction
Suppose we have data words of length m = 4. Then: (4 + r + 1)  2 r implies that r must be greater than or equal to 3. This means to build a code with 4-bit data words that will correct single-bit errors, we must add 3 check bits. Finding the number of check bits is the hard part. The rest is easy.

172 2.8 Error Detection and Correction
Suppose we have data words of length m = 8. Then: (8 + r + 1)  2 r implies that r must be greater than or equal to 4. This means to build a code with 8-bit data words that will correct single-bit errors, we must add 4 check bits, creating code words of length 12. So how do we assign values to these check bits?

173 2.8 Error Detection and Correction
With code words of length 12, we observe that each of the digits, 1 though 12, can be expressed in powers of 2. Thus: 1 = = = 2 = = = 3 = = = 4 = = = 1 (= 20) contributes to all of the odd-numbered digits. 2 (= 21) contributes to the digits, 2, 3, 6, 7, 10, and 11. . . . And so forth . . . We can use this idea in the creation of our check bits.

174 2.8 Error Detection and Correction
Using our code words of length 12, number each bit position starting with 1 in the low-order bit. Each bit position corresponding to an even power of 2 will be occupied by a check bit. These check bits contain the parity of each bit position for which it participates in the sum.

175 2.8 Error Detection and Correction
Since 2 (= 21) contributes to the digits, 2, 3, 6, 7, 10, and 11. Position 2 will contain the parity for bits 3, 6, 7, 10, and 11. When we use even parity, this is the modulo 2 sum of the participating bit values. For the bit values shown, we have a parity value of 0 in the second bit position. What are the values for the other parity bits?

176 2.8 Error Detection and Correction
The completed code word is shown above. Bit 1checks the digits, 3, 5, 7, 9, and 11, so its value is 1. Bit 4 checks the digits, 5, 6, 7, and 12, so its value is 1. Bit 8 checks the digits, 9, 10, 11, and 12, so its value is also 1. Using the Hamming algorithm, we can not only detect single bit errors in this code word, but also correct them!

177 2.8 Error Detection and Correction
Suppose an error occurs in bit 5, as shown above. Our parity bit values are: Bit 1 checks digits, 3, 5, 7, 9, and 11. Its value is 1, but should be zero. Bit 2 checks digits 2, 3, 6, 7, 10, and 11. The zero is correct. Bit 4 checks digits, 5, 6, 7, and 12. Its value is 1, but should be zero. Bit 8 checks digits, 9, 10, 11, and 12. This bit is correct.

178 2.8 Error Detection and Correction
We have erroneous bits in positions 1 and 4. With two parity bits that don’t check, we know that the error is in the data, and not in a parity bit. Which data bits are in error? We find out by adding the bit positions of the erroneous bits. Simply, = 5. This tells us that the error is in bit 5. If we change bit 5 to a 1, all parity bits check and our data is restored.

179 Chapter 2 Conclusion Computers store data in the form of bits, bytes, and words using the binary numbering system. Hexadecimal numbers are formed using four-bit groups called nibbles (or nybbles). Signed integers can be stored in one’s complement, two’s complement, or signed magnitude representation. Floating-point numbers are usually coded using the IEEE 754 floating-point standard.

180 Chapter 2 Conclusion Character data is stored using ASCII, EBCDIC, or Unicode. Data transmission and storage codes are devised to convey or store bytes reliably and economically. Error detecting and correcting codes are necessary because we can expect no transmission or storage medium to be perfect. CRC, Reed-Soloman, and Hamming codes are three important error control codes.

181 Chapter 2 Homework (part 1)
Due: 9/15/2010 Pages: 86-92 Exercises: 2, 5, 7, 9, 11, 13, 16, 24, 28, 33, 42.

182 Boolean Algebra and Digital Logic
Chapter 3 Boolean Algebra and Digital Logic

183 Chapter 3 Objectives Understand the relationship between Boolean logic and digital computer circuits. Learn how to design simple logic circuits. Understand how digital circuits work together to form complex computer systems.

184 3.1 Introduction In the latter part of the nineteenth century, George Boole incensed philosophers and mathematicians alike when he suggested that logical thought could be represented through mathematical equations. How dare anyone suggest that human thought could be encapsulated and manipulated like an algebraic formula? Computers, as we know them today, are implementations of Boole’s Laws of Thought. John Atanasoff and Claude Shannon were among the first to see this connection.

185 3.1 Introduction In the middle of the twentieth century, computers were commonly known as “thinking machines” and “electronic brains.” Many people were fearful of them. Nowadays, we rarely ponder the relationship between electronic digital computers and human logic. Computers are accepted as part of our lives. Many people, however, are still fearful of them. In this chapter, you will learn the simplicity that constitutes the essence of the machine.

186 3.2 Boolean Algebra Boolean algebra is a mathematical system for the manipulation of variables that can have one of two values. In formal logic, these values are “true” and “false.” In digital systems, these values are “on” and “off,” 1 and 0, or “high” and “low.” Boolean expressions are created by performing operations on Boolean variables. Common Boolean operators include AND, OR, and NOT.

187 3.2 Boolean Algebra A Boolean operator can be completely described using a truth table. The truth table for the Boolean operators AND and OR are shown at the right. The AND operator is also known as a Boolean product. The OR operator is the Boolean sum.

188 3.2 Boolean Algebra The truth table for the Boolean NOT operator is shown at the right. The NOT operation is most often designated by an overbar. It is sometimes indicated by a prime mark ( ‘ ) or an “elbow” ().

189 3.2 Boolean Algebra A Boolean function has:
At least one Boolean variable, At least one Boolean operator, and At least one input from the set {0,1}. It produces an output that is also a member of the set {0,1}. Now you know why the binary numbering system is so handy in digital systems.

190 3.2 Boolean Algebra The truth table for the Boolean function:
is shown at the right. To make evaluation of the Boolean function easier, the truth table contains extra (shaded) columns to hold evaluations of subparts of the function.

191 3.2 Boolean Algebra As with common arithmetic, Boolean operations have rules of precedence. The NOT operator has highest priority, followed by AND and then OR. This is how we chose the (shaded) function subparts in our table.

192 3.2 Boolean Algebra Digital computers contain circuits that implement Boolean functions. The simpler that we can make a Boolean function, the smaller the circuit that will result. Simpler circuits are cheaper to build, consume less power, and run faster than complex circuits. With this in mind, we always want to reduce our Boolean functions to their simplest form. There are a number of Boolean identities that help us to do this.

193 3.2 Boolean Algebra Most Boolean identities have an AND (product) form as well as an OR (sum) form. We give our identities using both forms. Our first group is rather intuitive:

194 3.2 Boolean Algebra Our second group of Boolean identities should be familiar to you from your study of algebra:

195 3.2 Boolean Algebra Our last group of Boolean identities are perhaps the most useful. If you have studied set theory or formal logic, these laws are also familiar to you.

196 3.2 Boolean Algebra We can use Boolean identities to simplify the function: as follows:

197 3.2 Boolean Algebra Sometimes it is more economical to build a circuit using the complement of a function (and complementing its result) than it is to implement the function directly. DeMorgan’s law provides an easy way of finding the complement of a Boolean function. Recall DeMorgan’s law states:

198 3.2 Boolean Algebra DeMorgan’s law can be extended to any number of variables. Replace each variable by its complement and change all ANDs to ORs and all ORs to ANDs. Thus, we find the complement of: is:

199 3.2 Boolean Algebra Through our exercises in simplifying Boolean expressions, we see that there are numerous ways of stating the same Boolean expression. These “synonymous” forms are logically equivalent. Logically equivalent expressions have identical truth tables. In order to eliminate as much confusion as possible, designers express Boolean functions in standardized or canonical form.

200 3.2 Boolean Algebra There are two canonical forms for Boolean expressions: sum-of-products and product-of-sums. Recall the Boolean product is the AND operation and the Boolean sum is the OR operation. In the sum-of-products form, ANDed variables are ORed together. For example: In the product-of-sums form, ORed variables are ANDed together:

201 3.2 Boolean Algebra It is easy to convert a function to sum-of-products form using its truth table. We are interested in the values of the variables that make the function true (=1). Using the truth table, we list the values of the variables that result in a true function value. Each group of variables is then ORed together.

202 3.2 Boolean Algebra The sum-of-products form for our function is:
We note that this function is not in simplest terms. Our aim is only to rewrite our function in canonical sum-of-products form.

203 3.3 Logic Gates We have looked at Boolean functions in abstract terms.
In this section, we see that Boolean functions are implemented in digital computer circuits called gates. A gate is an electronic device that produces a result based on two or more input values. In reality, gates consist of one to six transistors, but digital designers think of them as a single unit. Integrated circuits contain collections of gates suited to a particular purpose.

204 3.3 Logic Gates The three simplest gates are the AND, OR, and NOT gates. They correspond directly to their respective Boolean operations, as you can see by their truth tables.

205 3.3 Logic Gates Another very useful gate is the exclusive OR (XOR) gate. The output of the XOR operation is true only when the values of the inputs differ. Note the special symbol  for the XOR operation.

206 3.3 Logic Gates NAND and NOR are two very important gates. Their symbols and truth tables are shown at the right.

207 3.3 Logic Gates NAND and NOR are known as universal gates because they are inexpensive to manufacture and any Boolean function can be constructed using only NAND or only NOR gates.

208 3.3 Logic Gates Gates can have multiple inputs and more than one output. A second output can be provided for the complement of the operation. We’ll see more of this later.

209 3.4 Digital Components The main thing to remember is that combinations of gates implement Boolean functions. The circuit below implements the Boolean function: We simplify our Boolean expressions so that we can create simpler circuits.

210 3.5 Combinational Circuits
We have designed a circuit that implements the Boolean function: This circuit is an example of a combinational logic circuit. Combinational logic circuits produce a specified output (almost) at the instant when input values are applied. In a later section, we will explore circuits where this is not the case.

211 3.5 Combinational Circuits
Combinational logic circuits give us many useful devices. One of the simplest is the half adder, which finds the sum of two bits. We can gain some insight as to the construction of a half adder by looking at its truth table, shown at the right.

212 3.5 Combinational Circuits
As we see, the sum can be found using the XOR operation and the carry using the AND operation.

213 3.5 Combinational Circuits
We can change our half adder into to a full adder by including gates for processing the carry bit. The truth table for a full adder is shown at the right.

214 3.5 Combinational Circuits
How can we change the half adder shown below to make it a full adder?

215 3.5 Combinational Circuits
Here’s our completed full adder. (p109)

216 3.5 Combinational Circuits
Just as we combined half adders to make a full adder, full adders can connected in series. The carry bit “ripples” from one adder to the next; hence, this configuration is called a ripple-carry adder. Today’s systems employ more efficient adders.

217 3.5 Combinational Circuits
Decoders are another important type of combinational circuit. Among other things, they are useful in selecting a memory location according a binary value placed on the address lines of a memory bus. Address decoders with n inputs can select any of 2n locations. This is a block diagram for a decoder.

218 3.5 Combinational Circuits
This is what a 2-to-4 decoder looks like on the inside. If x = 0 and y = 1, which output line is enabled?

219 3.5 Combinational Circuits
A multiplexer does just the opposite of a decoder. It selects a single output from several inputs. The particular input chosen for output is determined by the value of the multiplexer’s control lines. To be able to select among n inputs, log2n control lines are needed. This is a block diagram for a multiplexer.

220 3.5 Combinational Circuits
This is what a 4-to-1 multiplexer looks like on the inside. If S0 = 1 and S1 = 0, which input is transferred to the output?

221 3.6 Sequential Circuits Combinational logic circuits are perfect for situations when we require the immediate application of a Boolean function to a set of inputs. There are other times, however, when we need a circuit to change its value with consideration to its current state as well as its inputs. These circuits have to “remember” their current state. Sequential logic circuits provide this functionality for us.

222 3.6 Sequential Circuits As the name implies, sequential logic circuits require a means by which events can be sequenced. State changes are controlled by clocks. A “clock” is a special circuit that sends electrical pulses through a circuit. Clocks produce electrical waveforms such as the one shown below.

223 3.6 Sequential Circuits State changes occur in sequential circuits only when the clock ticks. Circuits can change state on the rising edge, falling edge, or when the clock pulse reaches its highest voltage.

224 3.6 Sequential Circuits Circuits that change state on the rising edge, or falling edge of the clock pulse are called edge-triggered. Level-triggered circuits change state when the clock voltage reaches its highest or lowest level.

225 3.6 Sequential Circuits To retain their state values, sequential circuits rely on feedback. Feedback in digital circuits occurs when an output is looped back to the input. A simple example of this concept is shown below. If Q is 0 it will always be 0, if it is 1, it will always be 1. Why? (double-inverter) A one-bit buffer (memory)

226 3.6 Sequential Circuits See Morris Mano p245 (SR Latch)
You can see how feedback works by examining the most basic sequential logic components, the SR flip-flop. The “SR” stands for set/reset. The internals of an SR flip-flop (latch) are shown below, along with its block diagram. See Morris Mano p245 (SR Latch)

227 3.6 Sequential Circuits The behavior of an SR flip-flop is described by a characteristic table. Q(t) means the value of the output at time t. Q(t+1) is the value of Q after the next clock pulse.

228 3.6 Sequential Circuits The SR flip-flop actually has three inputs: S, R, and its current output, Q. Thus, we can construct a truth table for this circuit, as shown at the right. Notice the two undefined values. When both S and R are 1, the SR flip-flop is unstable.

229 3.6 Sequential Circuits If we can be sure that the inputs to an SR flip-flop will never both be 1, we will never have an unstable circuit. This may not always be the case. The SR flip-flop can be modified to provide a stable state when both inputs are 1. • This modified flip-flop is called a JK flip-flop, shown at the right. - The “JK” is in honor of Jack Kilby.

230 3.6 Sequential Circuits At the right, we see how an SR flip-flop can be modified to create a JK flip-flop. The characteristic table indicates that the flip-flop is stable for all inputs.

231 3.6 Sequential Circuits Another modification of the SR flip-flop is the D flip-flop, shown below with its characteristic table. You will notice that the output of the flip-flop remains the same during subsequent clock pulses. The output changes only when the value of D changes.

232 3.6 Sequential Circuits The D flip-flop is the fundamental circuit of computer memory. D flip-flops are usually illustrated using the block diagram shown below. The next slide shows how these circuits are combined to create a register.

233 3.6 Sequential Circuits This illustration shows a 4-bit register consisting of D flip-flops. You will usually see its block diagram (below) instead. A larger memory configuration is in your text. (p120)

234 3.6 Sequential Circuits A binary counter is another example of a sequential circuit. The low-order bit is complemented at each clock pulse. Whenever it changes from 0 to 1, the next bit is complemented, and so on through the other flip-flops. Refer Morris Mano p334

235 3.7 Designing Circuits We have seen digital circuits from two points of view: digital analysis and digital synthesis. Digital analysis explores the relationship between a circuits inputs and its outputs. Digital synthesis creates logic diagrams using the values specified in a truth table. Digital systems designers must also be mindful of the physical behaviors of circuits to include minute propagation delays that occur between the time when a circuit’s inputs are energized and when the output is accurate and stable.

236 3.7 Designing Circuits Digital designers rely on specialized software to create efficient circuits. Thus, software is an enabler for the construction of better hardware. Of course, software is in reality a collection of algorithms that could just as well be implemented in hardware. Recall the Principle of Equivalence of Hardware and Software.

237 3.7 Designing Circuits When we need to implement a simple, specialized algorithm and its execution speed must be as fast as possible, a hardware solution is often preferred. This is the idea behind embedded systems, which are small special-purpose computers that we find in many everyday things. Embedded systems require special programming that demands an understanding of the operation of digital circuits, the basics of which you have learned in this chapter.

238 Chapter 3 Conclusion Computers are implementations of Boolean logic.
Boolean functions are completely described by truth tables. Logic gates are small circuits that implement Boolean operators. The basic gates are AND, OR, and NOT. The XOR gate is very useful in parity checkers and adders. The “universal gates” are NOR, and NAND.

239 Chapter 3 Conclusion Computer circuits consist of combinational logic circuits and sequential logic circuits. Combinational circuits produce outputs (almost) immediately when their inputs change. Sequential circuits require clocks to control their changes of state. The basic sequential circuit unit is the flip-flop: The behaviors of the SR, JK, and D flip-flops are the most important to know.

240 Chapter 3 Homework Due: 9/22/2010 Pages: 124-130
Exercises: 2,4,9,10,19,22,26,28,32,34,36,38,40.

241 MARIE: An Introduction to a Simple Computer
Chapter 4 MARIE: An Introduction to a Simple Computer

242 Chapter 4 Objectives Learn the components common to every modern computer system. Be able to explain how each component contributes to program execution. Understand a simple architecture invented to illuminate these basic concepts, and how it relates to some real architectures. Know how the program assembly process works.

243 4.1 Introduction Chapter 1 presented a general overview of computer systems. In Chapter 2, we discussed how data is stored and manipulated by various computer system components. Chapter 3 described the fundamental components of digital circuits. Having this background, we can now understand how computer components work, and how they fit together to create useful computer systems.

244 4.1 Introduction The computer’s CPU fetches, decodes, and executes program instructions. The two principal parts of the CPU are the datapath and the control unit. The datapath consists of an arithmetic-logic unit and storage units (registers) that are interconnected by a data bus that is also connected to main memory. Various CPU components perform sequenced operations according to signals provided by its control unit.

245 4.1 Introduction Registers hold data that can be readily accessed by the CPU. They can be implemented using D flip-flops. A 32-bit register requires 32 D flip-flops. The arithmetic-logic unit (ALU) carries out logical and arithmetic operations as directed by the control unit. The control unit determines which actions to carry out according to the values in a program counter register and a status register.

246 4.1 Introduction The CPU shares data with other system components by way of a data bus. A bus is a set of wires that simultaneously convey a single bit along each line. Two types of buses are commonly found in computer systems: point-to-point, and multipoint buses. This is a point-to-point bus configuration:

247 A Multipoint Bus (p148)

248 4.1 Introduction Buses consist of data lines, control lines, and address lines. While the data lines convey bits from one device to another, control lines determine the direction of data flow, and when each device can access the bus. Address lines determine the location of the source or destination of the data. The next slide shows a model bus configuration.

249 4.1 Introduction

250 4.1 Introduction A multipoint bus is shown below.
Because a multipoint bus is a shared resource, access to it is controlled through protocols, which are built into the hardware.

251 4.1 Introduction In a master-slave configuration, where more than one device can be the bus master, concurrent bus master requests must be arbitrated. Four categories of bus arbitration are: Daisy chain: Permissions are passed from the highest-priority device to the lowest. Centralized parallel: Each device is directly connected to an arbitration circuit. Distributed using self-detection: Devices decide which gets the bus among themselves. Distributed using collision-detection: Any device can try to use the bus. If its data collides with the data of another device, it tries again.

252 4.1 Introduction Every computer contains at least one clock that synchronizes the activities of its components. A fixed number of clock cycles are required to carry out each data movement or computational operation. The clock frequency, measured in megahertz (MHz) or gigahertz (GHz), determines the speed with which all operations are carried out. Clock cycle time is the reciprocal of clock frequency. An 800 MHz clock has a cycle time of 1.25 ns.

253 4.1 Introduction Clock speed should not be confused with CPU performance. The CPU time required to run a program is given by the general performance equation: We see that we can improve CPU throughput when we reduce the number of instructions in a program, reduce the number of cycles per instruction, or reduce the number of nanoseconds per clock cycle. We will return to this important equation in later chapters.

254 4.1 Introduction A computer communicates with the outside world through its input/output (I/O) subsystem. I/O devices connect to the CPU through various interfaces. I/O can be memory-mapped-- where the I/O device behaves like main memory from the CPU’s point of view. Or I/O can be instruction-based, where the CPU has a specialized I/O instruction set. We study I/O in detail in chapter 7.

255 4.1 Introduction Computer memory consists of a linear array of addressable storage cells that are similar to registers. Memory can be byte-addressable, or word-addressable, where a word typically consists of two or more bytes. Memory is constructed of RAM chips, often referred to in terms of length  width. If the memory word size of the machine is 16 bits, then a 4M  16 RAM chip gives us 4 megabytes of 16-bit memory locations.

256 4.1 Introduction How does the computer access a memory location corresponds to a particular address? We observe that 4M can be expressed as 2 2  2 20 = 2 22 words. The memory locations for this memory are numbered 0 through Thus, the memory bus of this system requires at least 22 address lines. The address lines “count” from 0 to in binary. Each line is either “on” or “off” indicating the location of the desired memory element.

257 4.1 Introduction Physical memory usually consists of more than one RAM chip. Access is more efficient when memory is organized into banks of chips with the addresses interleaved across the chips With low-order interleaving, the low order bits of the address specify which memory bank contains the address of interest. Accordingly, in high-order interleaving, the high order address bits specify the memory bank. The next slide illustrates these two ideas.

258 Low-Order Interleaving High-Order Interleaving
4.1 Introduction Low-Order Interleaving High-Order Interleaving

259 4.1 Introduction The normal execution of a program is altered when an event of higher-priority occurs. The CPU is alerted to such an event through an interrupt. Interrupts can be triggered by I/O requests, arithmetic errors (such as division by zero), or when an invalid instruction is encountered. Each interrupt is associated with a procedure that directs the actions of the CPU when an interrupt occurs. Nonmaskable interrupts are high-priority interrupts that cannot be ignored.

260 4.2 MARIE We can now bring together many of the ideas that we have discussed to this point using a very simple model computer. Our model computer, the Machine Architecture that is Really Intuitive and Easy, MARIE, was designed for the singular purpose of illustrating basic computer system concepts. While this system is too simple to do anything useful in the real world, a deep understanding of its functions will enable you to comprehend system architectures that are much more complex.

261 4.2 MARIE The MARIE architecture has the following characteristics:
Binary, two's complement data representation. Stored program, fixed word length data and instructions. 4K words of word-addressable main memory. 16-bit data words. 16-bit instructions, 4 for the opcode and 12 for the address. A 16-bit arithmetic logic unit (ALU). Seven registers for control and data movement.

262 4.2 MARIE MARIE’s seven registers are:
Accumulator, AC, a 16-bit register that holds a conditional operator (e.g., "less than") or one operand of a two-operand instruction. Memory address register, MAR, a 12-bit register that holds the memory address of an instruction or the operand of an instruction. Memory buffer register, MBR, a 16-bit register that holds the data after its retrieval from, or before its placement in memory.

263 4.2 MARIE MARIE’s seven registers are:
Program counter, PC, a 12-bit register that holds the address of the next program instruction to be executed. Instruction register, IR, which holds an instruction immediately preceding its execution. Input register, InREG, an 8-bit register that holds data read from an input device. Output register, OutREG, an 8-bit register, that holds data that is ready for the output device.

264 4.2 MARIE This is the MARIE architecture shown graphically.

265 4.2 MARIE The registers are interconnected, and connected with main memory through a common data bus. Each device on the bus is identified by a unique number that is set on the control lines whenever that device is required to carry out an operation. Separate connections are also provided between the accumulator and the memory buffer register, and the ALU and the accumulator and memory buffer register. This permits data transfer between these devices without use of the main data bus.

266 4.2 MARIE This is the MARIE data path shown graphically.

267 4.2 MARIE A computer’s instruction set architecture (ISA) specifies the format of its instructions and the primitive operations that the machine can perform. The ISA is an interface between a computer’s hardware and its software. Some ISAs include hundreds of different instructions for processing data and controlling program execution. The MARIE ISA consists of only thirteen instructions.

268 4.2 MARIE This is the format of a MARIE instruction:
The fundamental MARIE instructions are:

269 4.2 MARIE This is a bit pattern for a LOAD instruction as it would appear in the IR: We see that the opcode is 1 and the address from which to load the data is 3.

270 4.2 MARIE This is a bit pattern for a SKIPCOND instruction as it would appear in the IR: We see that the opcode is 8 and bits 11 and 10 are 10, meaning that the next instruction will be skipped if the value in the AC is greater than zero. What is the hexadecimal representation of this instruction?

271 4.2 MARIE Each of our instructions actually consists of a sequence of smaller instructions called microoperations. The exact sequence of microoperations that are carried out by an instruction can be specified using register transfer language (RTL). In the MARIE RTL, we use the notation M[X] to indicate the actual data value stored in memory location X, and  to indicate the transfer of bytes to a register or memory location.

272 4.2 MARIE The RTL for the LOAD instruction is:
Similarly, the RTL for the ADD instruction is: MAR  X MBR  M[MAR], AC  MBR MAR  X MBR  M[MAR] AC  AC + MBR

273 4.2 MARIE Recall that SKIPCOND skips the next instruction according to the value of the AC. The RTL for the this instruction is the most complex in our instruction set: (see p165) If IR[ ] = 00 then // bit 11 = 0 and 10 = 0 // If AC < 0 then PC  PC + 1 else If IR[ ] = 01 then If AC = 0 then PC  PC + 1 else If IR[ ] = 11 then If AC > 0 then PC  PC + 1 // if bits 11 and 10 = 11, do nothing //

274 4.3 Instruction Processing
The fetch-decode-execute cycle is the series of steps that a computer carries out when it runs a program. We first have to fetch an instruction from memory, and place it into the IR. Once in the IR, it is decoded to determine what needs to be done next. If a memory value (operand) is involved in the operation, it is retrieved and placed into the MBR. With everything in place, the instruction is executed. The next slide shows a flowchart of this process.

275 4.3 Instruction Processing

276 4.4 A Simple Program Consider the simple MARIE program given below. We show a set of mnemonic instructions stored at addresses (hex): (Table 4.3, p169)

277 4.4 A Simple Program Let’s look at what happens inside the computer when our program runs. This is the LOAD 104 instruction:

278 4.4 A Simple Program Our second instruction is ADD 105:

279 MARIE Snapshop

280 4.5 A Discussion on Assemblers
Mnemonic instructions, such as LOAD 104, are easy for humans to write and understand. They are impossible for computers to understand. Assemblers translate instructions that are comprehensible to humans into the machine language that is comprehensible to computers We note the distinction between an assembler and a compiler: In assembly language, there is a one-to-one correspondence between a mnemonic instruction and its machine code. With compilers, this is not usually the case.

281 4.5 A Discussion on Assemblers
Assemblers create an object program file from mnemonic source code in two passes. During the first pass, the assembler assembles as much of the program is it can, while it builds a symbol table that contains memory references for all symbols in the program. During the second pass, the instructions are completed using the values from the symbol table.

282 4.5 A Discussion on Assemblers
Consider our previous example program. Note that we have included two directives HEX and DEC that specify the radix of the constants. During the first pass, we have a symbol table and the partial instructions shown at the bottom.

283 4.5 A Discussion on Assemblers
After the second pass, the assembly is complete.

284 4.6 Extending Our Instruction Set
So far, all of the MARIE instructions that we have discussed use a direct addressing mode. This means that the address of the operand is explicitly stated in the instruction. It is often useful to employ a indirect addressing, where the address of the address of the operand is given in the instruction. If you have ever used pointers in a program, you are already familiar with indirect addressing.

285 4.6 Extending Our Instruction Set
To help you see what happens at the machine level, we have included an indirect addressing mode instruction to the MARIE instruction set. The ADDI (ADD with Index) instruction specifies the address of the address of the operand (p175). The following RTL tells us what is happening at the register level: ADDI X MAR  X MBR  M[MAR] MAR  MBR AC  AC + MBR

286 4.6 Extending Our Instruction Set
Another helpful programming tool is the use of subroutines. The jump-and-store instruction, JNS, gives us limited subroutine functionality. The details of the JNS instruction are given by the following RTL (p175): JNS X // store PC at address X and jump to X+1 // MBR  PC MAR  X M[MAR]  MBR MBR  X AC  1 AC  AC + MBR PC  AC Does JNS permits recursive calls?

287 4.6 Extending Our Instruction Set
Our last helpful instruction is the CLEAR instruction. All it does is set the contents of the accumulator to all zeroes. This is the RTL for CLEAR: We put our new instructions to work in the program on the following slide. AC  0

288 4.6 Extending Our Instruction Set (pp176-178)
100 | LOAD Addr 101 | STORE Next 102 | LOAD Num 103 | SUBT One 104 | STORE Ctr 105 | CLEAR 106 |Loop LOAD Sum 107 | ADDI Next 108 | STORE Sum 109 | LOAD Next 10A | ADD One 10B | STORE Next 10C | LOAD Ctr 10D | SUBT One 10E | STORE Ctr 10F | SKIPCOND 000 110 | JUMP Loop 111 | HALT 112 |Addr HEX 118 113 |Next HEX 0 114 |Num DEC 5 115 |Sum DEC 0 116 |Ctr HEX 0 117 |One DEC 1 118 | DEC 10 119 | DEC 15 11A | DEC 2 11B | DEC 25 11C | DEC 30

289 4.7 A Discussion on Decoding
A computer’s control unit keeps things synchronized, making sure that bits flow to the correct components as the components are needed. There are two general ways in which a control unit can be implemented: hardwired control and microprogrammed control. With microprogrammed control, a small program is placed into read-only memory in the microcontroller. Hardwired controllers implement this program using digital logic components.

290 4.7 A Discussion on Decoding
For example, a hardwired control unit for our simple system would need a 4-to-14 decoder to decode the opcode of an instruction. The block diagram at the right, shows a general configuration for a hardwired control unit.

291 4.7 A Discussion on Decoding
In microprogrammed control, the control store is kept in ROM, PROM, or EPROM firmware, as shown below.

292 4.8 Real World Architectures
MARIE shares many features with modern architectures but it is not an accurate depiction of them. In the following slides, we briefly examine two machine architectures. We will look at an Intel architecture, which is a CISC machine and MIPS, which is a RISC machine. CISC is an acronym for complex instruction set computer. RISC stands for reduced instruction set computer. We delve into the “RISC versus CISC” argument in Chapter 9.

293 4.8 Real World Architectures
The classic Intel architecture, the 8086, was born in It is a CISC architecture. It was adopted by IBM for its famed PC, which was released in 1981. The 8086 operated on 16-bit data words and supported 20-bit memory addresses. Later, to lower costs, the 8-bit 8088 was introduced. Like the 8086, it used 20-bit memory addresses. What was the largest memory that the 8086 could address?

294 4.8 Real World Architectures
The 8086 had four 16-bit general-purpose registers that could be accessed by the half-word. It also had a flags register, an instruction register, and a stack accessed through the values in two other registers, the base pointer and the stack pointer. The 8086 had no built in floating-point processing. In 1980, Intel released the 8087 numeric coprocessor, but few users elected to install them because of their cost.

295 4.8 Real World Architectures
In 1985, Intel introduced the 32-bit It also had no built-in floating-point unit. The 80486, introduced in 1989, was an that had built-in floating-point processing and cache memory. The and offered downward compatibility with the 8086 and 8088. Software written for the smaller word systems was directed to use the lower 16 bits of the 32-bit registers.

296 4.8 Real World Architectures
Currently, Intel’s most advanced 32-bit microprocessor is the Pentium 4. It can run as fast as 3.06 GHz. This clock rate is over 350 times faster than that of the 8086. Speed enhancing features include multilevel cache and instruction pipelining. Intel, along with many others, is marrying many of the ideas of RISC architectures with microprocessors that are largely CISC.

297 4.8 Real World Architectures
The MIPS family of CPUs has been one of the most successful in its class. In 1986 the first MIPS CPU was announced. It had a 32-bit word size and could address 4GB of memory. Over the years, MIPS processors have been used in general purpose computers as well as in games. The MIPS architecture now offers 32- and 64-bit versions.

298 4.8 Real World Architectures
MIPS was one of the first RISC microprocessors. The original MIPS architecture had only 55 different instructions, as compared with the 8086 which had over 100. MIPS was designed with performance in mind: It is a load/store architecture, meaning that only the load and store instructions can access memory. The large number of registers in the MIPS architecture keeps bus traffic to a minimum. How does this design affect performance?

299 Chapter 4 Conclusion The major components of a computer system are its control unit, registers, memory, ALU, and data path. A built-in clock keeps everything synchronized. Control units can be microprogrammed or hardwired. Hardwired control units give better performance, while microprogrammed units are more adaptable to changes.

300 Chapter 4 Conclusion Computers run programs through iterative fetch-decode-execute cycles. Computers can run programs that are in machine language. An assembler converts mnemonic code to machine language. The Intel architecture is an example of a CISC architecture; MIPS is an example of a RISC architecture.

301 Chapter 4 Homework Due: 9/29/2010 Pages: 193-197
Exercises: 1,4,8,10,15(a), 26. TRUE/FALSE: 1,2,3,4,5,6,7,8.

302 A Closer Look at Instruction Set Architectures
Chapter 5 A Closer Look at Instruction Set Architectures

303 Chapter 5 Objectives Understand the factors involved in instruction set architecture design. Gain familiarity with memory addressing modes. Understand the concepts of instruction-level pipelining and its affect upon execution performance.

304 5.1 Introduction This chapter builds upon the ideas in Chapter 4.
We present a detailed look at different instruction formats, operand types, and memory access methods. We will see the interrelation between machine organization and instruction formats. This leads to a deeper understanding of computer architecture in general.

305 5.2 Instruction Formats Instruction sets are differentiated by the following: Number of bits per instruction. Stack-based or register-based. Number of explicit operands per instruction. Operand location. Types of operations. Type and size of operands.

306 5.2 Instruction Formats Instruction set architectures are measured according to: Main memory space occupied by a program. Instruction complexity. Instruction length (in bits). Total number of instructions in the instruction set.

307 5.2 Instruction Formats In designing an instruction set, consideration is given to: Instruction length. Whether short, long, or variable. Number of operands. Number of addressable registers. Memory organization. Whether byte- or word addressable. Addressing modes. Choose any or all: direct, indirect or indexed.

308 5.2 Instruction Formats Byte ordering, or endianness, is another major architectural consideration. If we have a two-byte integer, the integer may be stored so that the least significant byte is followed by the most significant byte or vice versa. In little endian machines, the least significant byte is followed by the most significant byte. Big endian machines store the most significant byte first (at the lower address).

309 5.2 Instruction Formats As an example, suppose we have the hexadecimal number The big endian and small endian arrangements of the bytes are shown below.

310 5.2 Instruction Formats Little endian:
Big endian: Is more natural. The sign of the number can be determined by looking at the byte at address offset 0. Strings and integers are stored in the same order. For most UNIX and RISC machines, and networks Adobe Photoshop, JPEG, MacPaint, and Sun raster files Little endian: Makes it easier to place values on non-word boundaries. Conversion from a 16-bit integer address to a 32-bit integer address does not require any arithmetic. For most personal computers (PCs) Windows BMP graphics format, GIF, PC Paintbrush, and Microsoft RTF MS WAV and AVI files, TIFF files, and XWD (X Windows Dump) support both endians.

311 5.2 Instruction Formats The next consideration for architecture design concerns how the CPU will store data. We have three choices: 1. A stack architecture 2. An accumulator architecture 3. A general purpose register architecture. In choosing one over the other, the tradeoffs are simplicity (and cost) of hardware design with execution speed and ease of use.

312 5.2 Instruction Formats In a stack architecture, instructions and operands are implicitly taken from the stack. A stack cannot be accessed randomly. In an accumulator architecture, one operand of a binary operation is implicitly in the accumulator. Accumulator is the only temporary storage Creating lots of bus traffic. E.g. MARIE In a general purpose register (GPR) architecture, registers can be used instead of memory. Faster than accumulator architecture. Efficient implementation for compilers. Results in longer instructions. The most popular architecture

313 5.2 Instruction Formats Most systems today are GPR systems.
GPR system has three types: Memory-memory where two or three operands may be in memory. Register-memory where at least one operand must be in a register. Load-store where no operands may be in memory. The number of operands and the number of available registers has a direct affect on instruction length.

314 5.2 Instruction Formats Stack machines use one - and zero-operand instructions. LOAD and STORE instructions require a single memory address operand. Other instructions use operands from the stack implicitly. PUSH and POP operations involve only the stack’s top element. Binary instructions (e.g., ADD, MULT) use the top two items on the stack.

315 5.2 Instruction Formats Stack architectures require us to think about arithmetic expressions a little differently. We are accustomed to writing expressions using infix notation, such as: Z = X + Y. Stack arithmetic requires that we use postfix notation: Z = XY+. This is also called reverse Polish notation, (somewhat) in honor of its Polish inventor, Jan Lukasiewicz ( ).

316 5.2 Instruction Formats The principal advantage of postfix notation is that parentheses are not used. For example, the infix expression, Z = (X  Y) + (W  U), becomes: Z = X Y  W U  + in postfix notation.

317 5.2 Instruction Formats In a stack ISA, the postfix expression, Z = X Y  W U  + might look like this: PUSH X PUSH Y MULT PUSH W PUSH U ADD PUSH Z Note: The result of a binary operation is implicitly stored on the top of the stack!

318 5.2 Instruction Formats In a one-address ISA, like MARIE, the infix expression, Z = X  Y + W  U looks like this: LOAD X MULT Y STORE TEMP LOAD W MULT U ADD TEMP STORE Z Note: One-address ISAs usually require one operand to be a register.

319 5.2 Instruction Formats In a two-address ISA, (e.g.,Intel, Motorola), the infix expression, Z = X  Y + W  U might look like this: LOAD R1,X MULT R1,Y LOAD R2,W MULT R2,U ADD R1,R2 STORE Z,R1

320 5.2 Instruction Formats With a three-address ISA, (e.g.,mainframes), the infix expression, Z = X  Y + W  U might look like this: MULT R1,X,Y MULT R2,W,U ADD Z,R1,R2 Would this program execute faster than the corresponding (longer) program that we saw in the stack-based ISA?

321 5.2 Instruction Formats We have seen how instruction length is affected by the number of operands supported by the ISA. In any instruction set, not all instructions require the same number of operands. Operations that require no operands, such as HALT, necessarily waste some space when fixed-length instructions are used. One way to recover some of this space is to use expanding opcodes.

322 5.2 Instruction Formats A system has 16 registers and 4K of memory.
We need 4 bits to access one of the registers. We also need 12 bits for a memory address. If the system is to have 16-bit instructions, we have two choices for our instructions:

323 5.2 Instruction Formats If we allow the length of the opcode to vary, we could create a very rich instruction set: Is there something missing from this instruction set?

324 5.3 Instruction types Instructions fall into several broad categories that you should be familiar with: Data movement. Arithmetic. Boolean. Bit manipulation. I/O. Control transfer. Special purpose. Can you think of some examples of each of these?

325 5.4 Addressing Addressing modes specify where an operand is located.
They can specify a constant, a register, or a memory location. The actual location of an operand is its effective address. Certain addressing modes allow us to determine the address of an operand dynamically.

326 5.4 Addressing Immediate addressing is where the data is part of the instruction. Direct addressing is where the address of the data is given in the instruction. Register addressing is where the data is located in a register. Indirect addressing gives the address of the address of the data in the instruction. Register indirect addressing uses a register to store the address of the address of the data.

327 5.4 Addressing Indexed addressing uses a register (implicitly or explicitly) as an offset, which is added to the address in the operand to determine the effective address of the data. Based addressing is similar except that a base register is used instead of an index register. The difference between these two is that an index register holds an offset relative to the address given in the instruction, a base register holds a base address where the address field represents a displacement from this base.

328 5.4 Addressing In stack addressing the operand is assumed to be on top of the stack. There are many variations to these addressing modes including: Indirect indexed. Base/offset. Self-relative Auto increment and auto decrement. We won’t cover these in detail. Let’s look at an example of the principal addressing modes.

329 5.4 Addressing For the instruction shown, what value is loaded into the accumulator for each addressing mode?

330 5.4 Addressing These are the values loaded into the accumulator for each addressing mode. (Assume R1 is the index register, for Indexed addressing: effective address is =1600 and its content is 700)

331 5.5 Instruction-Level Pipelining
Some CPUs divide the fetch-decode-execute cycle into smaller steps. These smaller steps can often be executed in parallel to increase throughput. Such parallel execution is called instruction-level pipelining. This term is sometimes abbreviated ILP in the literature. The next slide shows an example of instruction-level pipelining.

332 5.5 Instruction-Level Pipelining
Suppose a fetch-decode-execute cycle were broken into the following smaller steps: Suppose we have a six-stage pipeline. S1 fetches the instruction, S2 decodes it, S3 determines the address of the operands, S4 fetches them, S5 executes the instruction, and S6 stores the result. 1. Fetch instruction. 4. Fetch operands. 2. Decode opcode. 5. Execute instruction. 3. Calculate effective 6. Store result. address of operands.

333 5.5 Instruction-Level Pipelining
For every clock cycle, one small step is carried out, and the stages are overlapped. (p216) S1. Fetch instruction. S4. Fetch operands. S2. Decode opcode. S5. Execute. S3. Calculate effective S6. Store result. address of operands.

334 5.5 Instruction-Level Pipelining
The theoretical speedup offered by a pipeline can be determined as follows: Let tp be the time per stage. Each instruction represents a task, T, in the pipeline. The first task (instruction) requires k  tp time to complete in a k-stage pipeline. The remaining (n - 1) tasks emerge from the pipeline one per cycle. So the total time to complete the remaining tasks is (n - 1)tp. Thus, to complete n tasks using a k-stage pipeline requires: (k  tp) + (n - 1)tp = (k + n - 1)tp.

335 5.5 Instruction-Level Pipelining
If we take the time required to complete n tasks without a pipeline (ntn) and divide it by the time it takes to complete n tasks using a pipeline, we find: If we take the limit as n approaches infinity, (k + n - 1) approaches n, which results in a theoretical speedup of:

336 5.5 Instruction-Level Pipelining
Our neat equations take a number of things for granted. First, we have to assume that the architecture supports fetching instructions and data in parallel. Second, we assume that the pipeline can be kept filled at all times. This is not always the case. Pipeline hazards arise that cause pipeline conflicts and stalls.

337 5.5 Instruction-Level Pipelining
An instruction pipeline may stall, or be flushed for any of the following reasons: Resource conflicts. Data dependencies. Conditional branching. Measures can be taken at the software level as well as at the hardware level to reduce the effects of these hazards, but they cannot be totally eliminated.

338 5.6 Real-World Examples of ISAs
We return briefly to the Intel and MIPS architectures from the last chapter, using some of the ideas introduced in this chapter. Intel introduced pipelining to their processor line with its Pentium chip. The first Pentium had two five-stage pipelines. Each subsequent Pentium processor had a longer pipeline than its predecessor with the Pentium IV having a 24-stage pipeline. The Itanium (IA-64) has only a 10-stage pipeline.

339 5.6 Real-World Examples of ISAs
Intel processors support a wide array of addressing modes. The original 8086 provided 17 ways to address memory, most of them variants on the methods presented in this chapter. Owing to their need for backward compatibility, the Pentium chips also support these 17 addressing modes. The Itanium, having a RISC core, supports only one: register indirect addressing with optional post increment.

340 5.6 Real-World Examples of ISAs
MIPS was an acronym for Microprocessor Without Interlocked Pipeline Stages. The architecture is little endian and word-addressable with three-address, fixed-length instructions. Like Intel, the pipeline size of the MIPS processors has grown: The R2000 and R3000 have five-stage pipelines.; the R4000 and R4400 have 8-stage pipelines.

341 5.6 Real-World Examples of ISAs
The R10000 has three pipelines: A five-stage pipeline for integer instructions, a seven-stage pipeline for floating-point instructions, and a six-state pipeline for LOAD/STORE instructions. In all MIPS ISAs, only the LOAD and STORE instructions can access memory. The ISA uses only base addressing mode. The assembler accommodates programmers who need to use immediate, register, direct, indirect register, base, or indexed addressing modes.

342 5.6 Real-World Examples of ISAs
The Java programming language is an interpreted language that runs in a software machine called the Java Virtual Machine (JVM). A JVM is written in a native language for a wide array of processors, including MIPS and Intel. Like a real machine, the JVM has an ISA all of its own, called bytecode. This ISA was designed to be compatible with the architecture of any machine on which the JVM is running. The next slide shows how the pieces fit together.

343 5.6 Real-World Examples of ISAs

344 5.6 Real-World Examples of ISAs
Java bytecode is a stack-based language. Most instructions are zero address instructions. The JVM has four registers that provide access to five regions of main memory. All references to memory are offsets from these registers. Java uses no pointers or absolute memory references. Java was designed for platform interoperability, not performance!

345 Chapter 5 Conclusion ISAs are distinguished according to their bits per instruction, number of operands per instruction, operand location and types and sizes of operands. Endianness as another major architectural consideration. CPU can store store data based on 1. A stack architecture 2. An accumulator architecture 3. A general purpose register architecture.

346 Chapter 5 Conclusion Instructions can be fixed length or variable length. To enrich the instruction set for a fixed length instruction set, expanding opcodes can be used. The addressing mode of an ISA is also another important factor. We looked at: Immediate – Direct Register – Register Indirect Indirect – Indexed Based – Stack

347 Chapter 5 Conclusion A k-stage pipeline can theoretically produce execution speedup of k as compared to a non-pipelined machine. Pipeline hazards such as resource conflicts and conditional branching prevents this speedup from being achieved in practice. The Intel, MIPS, and JVM architectures provide good examples of the concepts presented in this chapter.

348 Chapter 5 Homework Due: 10/13/2010 Pages: 229-232
Exercises: 2,6,9,10(a),12,14,19

349 Chapter 6 Memory

350 Chapter 6 Objectives Master the concepts of hierarchical memory organization. Understand how each level of memory contributes to system performance, and how the performance is measured. Master the concepts behind cache memory, virtual memory, memory segmentation, paging and address translation.

351 6.1 Introduction Memory lies at the heart of the stored-program computer. In previous chapters, we studied the components from which memory is built and the ways in which memory is accessed by various ISAs. In this chapter, we focus on memory organization. A clear understanding of these ideas is essential for the analysis of system performance.

352 6.2 Types of Memory There are two kinds of main memory: random access memory, RAM, and read-only-memory, ROM. There are two types of RAM, dynamic RAM (DRAM) and static RAM (SRAM). Dynamic RAM consists of capacitors that slowly leak their charge over time. Thus they must be refreshed every few milliseconds to prevent data loss. DRAM is “cheap” memory owing to its simple design.

353 6.2 Types of Memory SRAM consists of circuits similar to the D flip-flop that we studied in Chapter 3. SRAM is very fast memory and it doesn’t need to be refreshed like DRAM does. It is used to build cache memory, which we will discuss in detail later. ROM also does not need to be refreshed, either. In fact, it needs very little charge to retain its memory. ROM is used to store permanent, or semi-permanent data that persists even while the system is turned off.

354 6.3 The Memory Hierarchy Generally speaking, faster memory is more expensive than slower memory. To provide the best performance at the lowest cost, memory is organized in a hierarchical fashion. Small, fast storage elements are kept in the CPU, larger, slower main memory is accessed through the data bus. Larger, (almost) permanent storage in the form of disk and tape drives is still further from the CPU.

355 6.3 The Memory Hierarchy This storage organization can be thought of as a pyramid:

356 6.3 The Memory Hierarchy To access a particular piece of data, the CPU first sends a request to its nearest memory, usually cache. If the data is not in cache, then main memory is queried. If the data is not in main memory, then the request goes to disk. Once the data is located in main memory, then the data, and a number of its nearby data elements are fetched into cache memory.

357 6.3 The Memory Hierarchy This leads us to some definitions.
A hit is when data is found at a given memory level. A miss is when it is not found. The hit rate is the percentage of time data is found at a given memory level. The miss rate is the percentage of time it is not. Miss rate = 1 - hit rate. The hit time is the time required to access data at a given memory level. The miss penalty is the time required to process a miss, including the time that it takes to replace a block of memory plus the time it takes to deliver the data to the processor.

358 6.3 The Memory Hierarchy An entire block of data is copied after a hit because the principle of locality tells us that once a byte is accessed, it is likely that a nearby data element will be needed soon. There are three forms of locality: Temporal locality- Recently-accessed data elements tend to be accessed again. Spatial locality - Accesses tend to cluster. Sequential locality - Instructions tend to be accessed sequentially.

359 6.4 Cache Memory The purpose of cache memory is to speed up accesses by storing recently used data closer to the CPU, instead of storing it in main memory. Although cache is much smaller than main memory, its access time is a fraction of that of main memory. Unlike main memory, which is accessed by address, cache is typically accessed by content; hence, it is often called content addressable memory. Because of this, a single large cache memory isn’t always desirable -- it takes longer to search.

360 6.4 Cache Memory The “content” that is addressed in content addressable cache memory is a subset of the bits of a main memory address called a field. The fields into which a memory address is divided provide a many-to-one mapping between larger main memory and the smaller cache memory. Many blocks of main memory map to a single block of cache. A tag field in the cache block distinguishes one cached memory block from another.

361 6.4 Cache Memory The simplest cache mapping scheme is direct mapped cache. (Fig. 6.2, p241) In a direct mapped cache consisting of N blocks of cache, block X of main memory maps to cache block Y = X mod N. Thus, if we have 10 blocks of cache, block 7 of cache may hold blocks 7, 17, 27, 37, of main memory. Once a block of memory is copied into its slot in cache, a valid bit is set for the cache block to let the system know that the block contains valid data. What could happen without having a valid bit?

362 6.4 Cache Memory The diagram below is a schematic of what cache looks like. Block 0 contains multiple words from main memory, identified with the tag Block 1 contains words identified with the tag The other two blocks are not valid.

363 6.4 Cache Memory The size of each field into which a memory address is divided depends on the size of the cache. Suppose our memory consists of 214 words, cache has 16 = 24 blocks, and each block holds 8 words. Thus main memory is divided into 214 / 2 3 = 211 blocks. For our main memory field sizes, we know we need 4 bits for the block, 3 bits for the word, and the tag is what’s left over:

364 6.4 Cache Memory As an example, suppose a program generates the address 1AA. In 14-bit binary, this number is: The first 7 bits of this address go in the tag field, the next 4 bits go in the block field, and the final 3 bits indicate the word within the block in main memory.

365 6.4 Cache Memory If subsequently the program generates the address 1AB( ), it will find the data it is looking for in block 0101, word 011. Tag Block Word However, if the program generates the address, 3AB ( ), instead, the data it is looking for the same block 0101, and same word 011. Tag Block Word The block loaded for address 1AB would be evicted from the cache, and replaced by the block associated with the 3AB reference.

366 6.4 Cache Memory Suppose a program generates a series of memory references such as: 1AB, 3AB, 1AB, 3AB, The cache will continually evict and replace blocks. The theoretical advantage offered by the cache is lost in this extreme case. This is the main disadvantage of direct mapped cache. Other cache mapping schemes are designed to prevent this kind of thrashing.

367 6.4 Cache Memory Instead of placing memory blocks in specific cache locations based on memory address, we could allow a block to go anywhere in cache. In this way, cache would have to fill up before any blocks are evicted. This is how fully associative cache works. A memory address is partitioned into only two fields: the tag and the word.

368 6.4 Cache Memory Suppose, as before, we have 14-bit memory addresses and a cache with 16 blocks, each block of size 8 words. The field format of a main memory reference is: When the cache is searched, all tags are searched in parallel to retrieve the data quickly. This requires special, costly hardware.

369 6.4 Cache Memory You will recall that direct mapped cache evicts a block whenever another memory reference needs that block. With fully associative cache, we have no such mapping, thus we must devise a replacement algorithm to determine which block to evict from the cache. The block that is evicted is the victim block. There are a number of ways to pick a victim, we will discuss them shortly.

370 6.4 Cache Memory Set associative cache combines the ideas of direct mapped cache and fully associative cache. An N-way set associative cache mapping is like direct mapped cache in that a memory reference maps to a particular location in cache. Unlike direct mapped cache, a memory reference maps to a set of several cache blocks, similar to the way in which fully associative cache works. Instead of mapping anywhere in the entire cache, a memory reference can map only to the subset of cache slots.

371 6.4 Cache Memory The number of cache blocks per set in set associative cache varies according to overall system design. For example, a 2-way set associative cache can be conceptualized as shown in the schematic below. Each set contains two different memory blocks.

372 6.4 Cache Memory In set associative cache mapping, a main memory reference is divided into three fields: tag, set, and word, as shown below (Fig. 6.10, p247). As with direct-mapped cache, the word field chooses the word within the cache block, and the tag field uniquely identifies the memory address. The set field determines the set to which the memory block maps.

373 6.4 Cache Memory Suppose we have a main memory of 214 bytes.
This memory is mapped to a 2-way set associative cache having 16 blocks where each block contains 8 words. Since this is a 2-way cache, each set consists of 2 blocks, and there are 8 sets (2 X 8 = 16 blocks). Thus, we need 3 bits for the set, 3 bits for the word, giving 8 leftover bits for the tag:

374 6.4 Cache Memory With fully associative and set associative cache, a replacement policy is invoked when it becomes necessary to evict a block from cache. An optimal replacement policy would be able to look into the future to see which blocks won’t be needed for the longest period of time. Although it is impossible to implement an optimal replacement algorithm, it is instructive to use it as a benchmark for assessing the efficiency of any other scheme we come up with.

375 6.4 Cache Memory The replacement policy that we choose depends upon the locality that we are trying to optimize-- usually, we are interested in temporal locality. A least recently used (LRU) algorithm keeps track of the last time that a block was assessed and evicts the block that has been unused for the longest period of time. The disadvantage of this approach is its complexity: LRU has to maintain an access history for each block, which ultimately slows down the cache.

376 6.4 Cache Memory First-in, first-out (FIFO) is a popular cache replacement policy. In FIFO, the block that has been in the cache the longest, regardless of when it was last used. A random replacement policy does what its name implies: It picks a block at random and replaces it with a new block. Random replacement can certainly evict a block that will be needed often or needed soon, but it never thrashes.

377 6.4 Cache Memory The performance of hierarchical memory is measured by its effective access time (EAT). EAT is a weighted average that takes into account the hit ratio and relative access times of successive levels of memory. The EAT for a two-level memory is given by: EAT = H  AccessC + (1-H)  AccessMM. where H is the cache hit rate and AccessC and AccessMM are the access times for cache and main memory, respectively.

378 6.4 Cache Memory For example, consider a system with a main memory access time of 200ns supported by a cache having a 10ns access time and a hit rate of 99%. The EAT is: 0.99(10ns) (200ns) = 9.9ns + 2ns = 11ns. This equation for determining the effective access time can be extended to any number of memory levels, as we will see in later sections.

379 6.4 Cache Memory Cache replacement policies must also take into account dirty blocks, those blocks that have been updated while they were in the cache. Dirty blocks must be written back to memory. A write policy determines how this will be done. There are two types of write policies,write through and write back. Write through updates cache and main memory simultaneously on every write.

380 6.4 Cache Memory Write back (also called copyback) updates memory only when the block is selected for replacement. The disadvantage of write through is that memory must be updated with each cache write, which slows down the access time on updates. This slowdown is usually negligible, because the majority of accesses tend to be reads, not writes. The advantage of write back is that memory traffic is minimized, but its disadvantage is that memory does not always agree (keep) with the value in cache, causing problems in systems with many concurrent users.

381 6.5 Virtual Memory Cache memory enhances performance by providing faster memory access speed. Virtual memory enhances performance by providing greater memory capacity, without the expense of adding main memory. Instead, a portion of a disk drive serves as an extension of main memory. If a system uses paging, virtual memory partitions main memory into individually managed page frames, that are written (or paged) to disk when they are not immediately needed.

382 6.5 Virtual Memory A physical address is the actual memory address of physical memory. Programs create virtual addresses that are mapped to physical addresses by the memory manager. Page faults occur when a logical address requires that a page be brought in from disk. Memory fragmentation occurs when the paging process results in the creation of small, unusable clusters of memory addresses.

383 6.5 Virtual Memory Main memory and virtual memory are divided into equal sized pages. The entire address space required by a process need not be in memory at once. Some parts can be on disk, while others are in main memory. Further, the pages allocated to a process do not need to be stored contiguously -- either on disk or in memory. In this way, only the needed pages are in memory at any time, the unnecessary pages are in slower disk storage.

384 6.5 Virtual Memory Information concerning the location of each page, whether on disk or in memory, is maintained in a data structure called a page table (shown below). There is one page table for each active process.

385 6.5 Virtual Memory When a process generates a virtual address, the operating system translates it into a physical memory address. To accomplish this, the virtual address is divided into two fields: A page field, and an offset field. The page field determines the page location of the address, and the offset indicates the location of the address within the page. The logical page number is translated into a physical page frame through a lookup in the page table.

386 6.5 Virtual Memory If the valid bit is zero in the page table entry for the logical address, this means that the page is not in memory and must be fetched from disk. This is a page fault. If necessary, a page is evicted from memory and is replaced by the page retrieved from disk, and the valid bit is set to 1. If the valid bit is 1, the virtual page number is replaced by the physical frame number. The data is then accessed by adding the offset to the physical frame number.

387 6.5 Virtual Memory As an example, suppose a system has a virtual address space of 8K, each page has 1K, and a physical address space of 4K bytes. The system uses byte addressing. We have 213/210 = 23 virtual pages. A virtual address has 13 bits (8K = 213) with 3 bits for the page field and 10 for the offset, because the page size is 1024. A physical memory address requires 12 bits, the first two bits for the page frame and the trailing 10 bits the offset.

388 6.5 Virtual Memory Suppose we have the page table shown below.
What happens when CPU generates address = ? (in page 5, the first 3 bits is 101)

389 6.5 Virtual Memory The address is converted to physical address because the page field 101 is replaced by frame number 01 (in frame #1) through a lookup in the page table.

390 6.5 Virtual Memory What happens when the CPU generates address ? (first 3 bits is 100, in page #4)

391 6.5 Virtual Memory We said earlier that effective access time (EAT) takes all levels of memory into consideration. Thus, virtual memory is also a factor in the calculation, and we also have to consider page table access time. Suppose a main memory access takes 200ns, the page fault rate is 1%, and it takes 10ms to load a page from disk. We have: EAT = 0.99(200ns + 200ns) (10ms) = 100,396ns.

392 The next slide shows how all the pieces fit together.
6.5 Virtual Memory Even if we had no page faults, the EAT would be 400ns because memory is always read twice: First to access the page table, and second to load the page from memory. Because page tables are read constantly, it makes sense to keep most recent page lookup values in a special cache called a translation look-aside buffer (TLB). TLBs are a special associative cache that stores the mapping of virtual pages to physical pages. The next slide shows how all the pieces fit together.

393 Fig.6.17 P260

394 6.5 Virtual Memory

395 6.5 Virtual Memory Another approach to virtual memory is the use of segmentation. Instead of dividing memory into equal-sized pages, virtual address space is divided into variable-length segments, often under the control of the programmer. A segment is located through its entry in a segment table, which contains the segment’s memory location and a bounds limit that indicates its size. After a page fault, the operating system searches for a location in memory large enough to hold the segment that is retrieved from disk.

396 6.5 Virtual Memory Both paging and segmentation can cause fragmentation. Paging is subject to internal fragmentation because a process may not need the entire range of addresses contained within the page. Thus, there may be many pages containing unused fragments of memory. Segmentation is subject to external fragmentation, which occurs when contiguous chunks of memory become broken up as segments are allocated and deallocated over time.

397 6.5 Virtual Memory Large page tables are cumbersome and slow, but with its uniform memory mapping, page operations are fast. Segmentation allows fast access to the segment table, but segment loading is labor-intensive. Paging and segmentation can be combined to take advantage of the best features of both by assigning fixed-size pages within variable-sized segments. Each segment has a page table. This means that a memory address will have three fields, one for the segment, another for the page, and a third for the offset.

398 6.6 A Real-World Example The Pentium architecture supports both paging and segmentation, and they can be used in various combinations including unpaged unsegmented, segmented unpaged, unsegmented paged, and segmented paged memory (pp ). The processor supports two levels of cache (L1 and L2), both having a block size of 32 bytes. The L1 cache is next to the processor, and the L2 cache sits between the processor and memory. The L1 cache is in two parts: and instruction cache (I-cache) and a data cache (D-cache). The next slide shows this organization schematically.

399 6.6 A Real-World Example

400 Chapter 6 Conclusion Computer memory is organized in a hierarchy, with the smallest, fastest memory at the top and the largest, slowest memory at the bottom. Cache memory gives faster access to main memory, while virtual memory uses disk storage to give the illusion of having a large main memory. Cache maps blocks of main memory to blocks of cache memory. Virtual memory maps page frames to virtual pages. There are three general types of cache: Direct mapped, fully associative and set associative.

401 Chapter 6 Conclusion With fully associative and set associative cache, as well as with virtual memory, replacement policies must be established. Replacement policies include LRU, FIFO, or LFU. These policies must also take into account what to do with dirty blocks. All virtual memory must deal with fragmentation, internal for paged memory, external for segmented memory.

402 Chapter 6 Homework Due: 10/20/2010 Pages: 267-272
Exercises: 2,4,6,8,11,12,15,16

403 Input/Output and Storage Systems
Chapter 7 Input/Output and Storage Systems

404 Chapter 7 Objectives Understand how I/O systems work, including I/O methods and architectures. Become familiar with storage media, and the differences in their respective formats. Understand how RAID improves disk performance and reliability. Become familiar with the concepts of data compression and applications suitable for each type of compression algorithm.

405 7.1 Introduction Data storage and retrieval is one of the primary functions of computer systems. Sluggish I/O performance can have a ripple effect, dragging down overall system performance. This is especially true when virtual memory is involved. The fastest processor in the world is of little use if it spends most of its time waiting for data.

406 7.2 Amdahl’s Law The overall performance of a system is a result of the interaction of all of its components. System performance is most effectively improved when the performance of the most heavily used components is improved. This idea is quantified by Amdahl’s Law: where S is the overall speedup; f is the fraction of work performed by a faster component; and k is the speedup of the faster component.

407 7.2 Amdahl’s Law Amdahl’s Law gives us a handy way to estimate the performance improvement we can expect when we upgrade a system component. On a large system, suppose we can upgrade a CPU to make it 50% faster for $10,000 or upgrade its disk drives for $7,000 to make them 250% faster. Processes spend 70% of their time running in the CPU and 30% of their time waiting for disk service. An upgrade of which component would offer the greater benefit for the lesser cost?

408 7.2 Amdahl’s Law The processor option offers a speedup of 1.3 times, (S = 1.3) or 30%: And the disk drive option gives a speedup of 1.22 times (S = 1.22), or 22%: Each 1% of improvement for the processor costs $333 (10000/30), and for the disk a 1% improvement costs $318 (7000/22). Should price/performance be your only concern?

409 7.3 I/O Architectures We define input/output as a subsystem of components that moves coded data between external devices and a host system. I/O subsystems include: Blocks of main memory that are devoted to I/O functions. Buses that move data into and out of the system. Control modules in the host and in peripheral devices Interfaces to external components such as keyboards and disks. Cabling or communications links between the host system and its peripherals.

410 7.3 I/O Architectures This is a model I/O configuration.

411 7.3 I/O Architectures I/O can be controlled in four general ways.
Programmed I/O reserves a register for each I/O device. Each register is continually polled to detect data arrival. Interrupt-Driven I/O allows the CPU to do other things until I/O is requested (interrupts CPU). Direct Memory Access (DMA) offloads I/O processing to a special-purpose chip that takes care of the details. Channel I/O uses dedicated I/O processors.

412 7.3 I/O Architectures This is a DMA configuration.
Notice that the DMA and the CPU share the bus. The DMA runs at a higher priority and steals memory cycles (cycle stealing) from the CPU.

413 7.3 I/O Architectures Very large systems (mainframes) employ channel I/O. Channel I/O consists of one or more I/O processors (IOPs) that control various channel paths. Slower devices such as terminals and printers are combined (multiplexed) into a single faster channel. On IBM mainframes, multiplexed channels are called multiplexor channels, the faster ones are called selector channels.

414 7.3 I/O Architectures Channel I/O is distinguished from DMA by the intelligence of the IOPs. The IOP negotiates protocols, issues device commands, translates storage coding to memory coding, and can transfer entire files or groups of files independent of the host CPU. The host has only to create the program instructions for the I/O operation and tell the IOP where to find them.

415 7.3 I/O Architectures This is a channel I/O configuration.

416 7.3 I/O Architectures I/O buses, unlike memory buses, operate asynchronously. Requests for bus access must be arbitrated among the devices involved. Bus control lines activate the devices when they are needed, raise signals when errors have occurred, and reset devices when necessary. The number of data lines is the width of the bus. A bus clock coordinates activities and provides bit cell boundaries.

417 7.3 I/O Architectures This is how a bus connects to a disk drive.

418 7.3 I/O Architectures Timing diagrams, such as this one, defines bus operations in detail. (see p282, steps 1-5)

419 7.4 Magnetic Disk Technology
Magnetic disks offer large amounts of durable storage that can be accessed quickly. Disk drives are called random (or direct) access storage devices, because blocks of data can be accessed according to their location on the disk. This term was coined when all other durable storage (e.g., tape) was sequential. Magnetic disk organization is shown on the following slide.

420 7.4 Magnetic Disk Technology
Disk tracks are numbered from the outside edge, starting with zero.

421 7.4 Magnetic Disk Technology
Hard disk platters are mounted on spindles. Read/write heads are mounted on a comb that swings radially to read the disk.

422 7.4 Magnetic Disk Technology
The rotating disk forms a logical cylinder beneath the read/write heads. Data blocks are addressed by their cylinder, surface, and sector.

423 7.4 Magnetic Disk Technology
There are a number of electromechanical properties of hard disk drives that determine how fast its data can be accessed. Seek time is the time that it takes for a disk arm to move into position over the desired cylinder. Rotational delay is the time that it takes for the desired sector to move into position beneath the read/write head. Seek time + rotational delay = access time.

424 7.4 Magnetic Disk Technology
Transfer rate gives us the rate at which data can be read from the disk. Average latency is a function of the rotational speed: Mean Time To Failure (MTTF) is a statistically-determined value often calculated experimentally. It usually doesn’t tell us much about the actual expected life of the disk. Design life is usually more realistic. Figure 7.11 in the text shows a sample disk specification.

425 7.4 Magnetic Disk Technology
Floppy (flexible) disks are organized in the same way as hard disks, with concentric tracks that are divided into sectors. Physical and logical limitations restrict floppies to much lower densities than hard disks. A major logical limitation of the DOS/Windows floppy diskette is the organization of its file allocation table (FAT). The FAT gives the status of each sector on the disk: free, in use, damaged, reserved, etc.

426 7.4 Magnetic Disk Technology
On a standard 1.44MB floppy, the FAT is limited to nine 512-byte sectors. There are two copies of the FAT. There are 18 sectors per track and 80 tracks on each surface of a floppy, for a total of 2880 sectors on the disk. So each FAT entry needs at least 14 bits (214=4096 < 213 = 2048). FAT entries are actually 16 bits, and the organization is called FAT16.

427 7.4 Magnetic Disk Technology
The disk directory associates logical file names with physical disk locations. Directories contain a file name and the file’s first FAT entry. If the file spans more than one sector (or cluster), the FAT contains a pointer to the next cluster (and FAT entry) for the file. The FAT is read like a linked list until the <EOF> entry is found.

428 7.4 Magnetic Disk Technology
A directory entry says that a file we want to read starts at sector 121 in the FAT fragment shown below. Sectors 121, 124, 126, and 122 are read. After each sector is read, its FAT entry is to find the next sector occupied by the file. At the FAT entry for sector 122, we find the end-of-file marker <EOF>. How many disk accesses are required to read this file?

429 7.5 Optical Disks Optical disks provide large storage capacities very inexpensively. They come in a number of varieties including CD-ROM, DVD, and WORM (write-once-read-many- times). Many large computer installations produce document output on optical disk rather than on paper. This idea is called COLD-- Computer Output Laser Disk. It is estimated that optical disks can endure for a hundred years. Other media are good for only a decade-- at best.

430 7.5 Optical Disks CD-ROMs were designed by the music industry in the 1980s, and later adapted to data. This history is reflected by the fact that data is recorded in a single spiral track, starting from the center of the disk and spanning outward. Binary ones and zeros are delineated by bumps in the polycarbonate disk substrate. The transitions between pits and lands define binary ones. If you could unravel a full CD-ROM track, it would be nearly five miles long!

431 7.5 Optical Disks The logical data format for a CD-ROM is much more complex than that of a magnetic disk. (See the text for details.) Different formats are provided for data and music. Two levels of error correction are provided for the data format. DVDs can be thought of as quad-density CDs. Where a CD-ROM can hold at most 650MB of data, DVDs can hold as much as 8.54GB. It is possible that someday DVDs will make CDs obsolete.

432 7.6 Magnetic Tape First-generation magnetic tape was not much more than wide analog recording tape, having capacities under 11MB. Data was usually written in nine vertical tracks:

433 7.6 Magnetic Tape Today’s tapes are digital, and provide multiple gigabytes of data storage. Two dominant recording methods are serpentine and helical scan, which are distinguished by how the read-write head passes over the recording medium. Serpentine recording is used in digital linear tape (DLT) and Quarter inch cartridge (QIC) tape systems. Digital audio tape (DAT) systems employ helical scan recording. These two recording methods are shown on the next slide.

434 7.6 Magnetic Tape  Serpentine Helical Scan 

435 7.7 RAID RAID, an acronym for Redundant Array of Independent Disks was invented to address problems of disk reliability, cost, and performance. In RAID, data is stored across many disks, with extra disks added to the array to provide error correction (redundancy). The inventors of RAID, David Patterson, Garth Gibson, and Randy Katz, provided a RAID taxonomy that has persisted for a quarter of a century, despite many efforts to redefine it.

436 7.7 RAID RAID Level 0, also known as drive spanning, provides improved performance, but no redundancy. Data is written in blocks across the entire array The disadvantage of RAID 0 is in its low reliability.

437 7.7 RAID RAID Level 1, also known as disk mirroring, provides 100% redundancy, and good performance. Two matched sets of disks contain the same data. The disadvantage of RAID 1 is cost.

438 7.7 RAID A RAID Level 2 configuration consists of a set of data drives, and a set of Hamming code drives. Hamming code drives provide error correction for the data drives. RAID 2 performance is poor (slow) and the cost is relatively high.

439 7.7 RAID RAID Level 3 stripes bits across a set of data drives and provides a separate disk for parity. Parity is the XOR of the data bits. RAID 3 is not suitable for commercial applications, but is good for personal systems.

440 7.7 RAID RAID Level 4 is like adding parity disks to RAID 0.
Data is written in blocks across the data disks, and a parity block is written to the redundant drive. RAID 4 would be feasible if all record blocks were the same size, such as audio/video data. Poor performance, no commercial implementation of RAID-4.

441 7.7 RAID RAID Level 5 is RAID 4 with distributed parity.
With distributed parity, some accesses can be serviced concurrently, giving good performance and high reliability. RAID 5 is used in many commercial systems.

442 7.7 RAID RAID Level 6 carries two levels of error protection over striped data: Reed-Soloman and parity. It can tolerate the loss of two disks. RAID 6 is write-intensive, but highly fault-tolerant.

443 7.7 RAID Large systems consisting of many drive arrays may employ various RAID levels, depending on the criticality of the data on the drives. A disk array that provides program workspace (say for file sorting) does not require high fault tolerance. Critical, high-throughput files can benefit from combining RAID 0 with RAID 1, called RAID 10. Keep in mind that a higher RAID level does not necessarily mean a “better” RAID level. It all depends upon the needs of the applications that use the disks.

444 7.8 Data Compression Data compression is important to storage systems because it allows more bytes to be packed into a given storage medium than when the data is uncompressed. Some storage devices (notably tape) compress data automatically as it is written, resulting in less tape consumption and significantly faster backup operations. Compression also reduces Internet file transfer time, saving time and communications bandwidth.

445 7.8 Data Compression A good metric for compression is the compression factor (or compression ratio) given by: If we have a 100KB file that we compress to 40KB, we have a compression factor of:

446 7.8 Data Compression H= -P(x)  log2P(xi)
Compression is achieved by removing data redundancy while preserving information content. The information content of a group of bytes (a message) is its entropy. Data with low entropy permit a larger compression ratio than data with high entropy. Entropy, H, is a function of symbol frequency. It is the weighted average of the number of bits required to encode the symbols of a message: H= -P(x)  log2P(xi)

447  [P(x)  li ] -  [-P(x)  log2P(xi)]
7.8 Data Compression The entropy of the entire message is the sum of the individual symbol entropies.  [-P(x)  log2P(xi)] The average redundancy for each character in a message of length l is given by:  [P(x)  li ] -  [-P(x)  log2P(xi)]

448 7.8 Data Compression Consider the message: HELLO WORLD!
The letter L has a probability of 3/12 = 1/4 of appearing in this message. The number of bits required to encode this symbol is -log2(1/4) = 2. Using our formula,  -P(xi)  log2P(xi), the average entropy of the entire message is This means that the theoretical minimum number of bits per character is Theoretically, the message could be sent using only 37 bits. (3.022 12 = 36.26)

449 7.8 Data Compression The entropy metric just described forms the basis for statistical data compression. Two widely-used statistical coding algorithms are Huffman coding and arithmetic coding. Huffman coding builds a binary tree from the letter frequencies in the message. The binary symbols for each character are read directly from the tree. Symbols with the highest frequencies end up at the top of the tree, and result in the shortest codes. An example is shown on the next slide.

450 7.8 Data Compression (pp312-315)
HIGGLETY PIGGLTY POP THE DOG HAS EATEN THE MOP THE PIGS IN A HURRY THE CATS IN A FLURRY

451 7.8 Data Compression The second type of statistical coding, arithmetic coding, partitions the real number interval between 0 and 1 into segments according to symbol probabilities. An abbreviated algorithm for this process is given in the text. Arithmetic coding is computationally intensive and it runs the risk of causing divide underflow. Variations in floating-point representation among various systems can also cause the terminal condition (a zero value) to be missed.

452 7.8 Data Compression For most data, statistical coding methods offer excellent compression ratios. Their main disadvantage is that they require two passes over the data to be encoded. The first pass calculates probabilities, the second encodes the message. This approach is unacceptably slow for storage systems, where data must be read, written, and compressed within one pass over a file.

453 7.8 Data Compression Ziv-Lempel (LZ) dictionary systems solve the two-pass problem by using values in the data as a dictionary to encode itself. The LZ77 compression algorithm employs a text window in conjunction with a lookahead buffer. The text window serves as the dictionary. If text is found in the lookahead buffer that matches text in the dictionary, the location and length of the text in the window is output.

454 7.8 Data Compression The LZ77 implementations include PKZIP and IBM’s RAMAC RVA 2 Turbo disk array. The simplicity of LZ77 lends itself well to a hardware implementation. LZ78 is another dictionary coding system. It removes the LZ77 constraint of a fixed-size window. Instead, it creates a trie as the data is read. Where LZ77 uses pointers to locations in a dictionary, LZ78 uses pointers to nodes in the trie.

455 7.8 Data Compression GIF compression is a variant of LZ78, called LZW, for Lempel-Ziv-Welsh. It improves upon LZ78 through its efficient management of the size of the trie. Terry Welsh, the designer of LZW, was employed by the Unisys Corporation when he created the algorithm, and Unisys subsequently patented it. Owing to royalty disputes, development of another algorithm PNG, was hastened.

456 7.8 Data Compression PNG employs two types of compression, first a Huffman algorithm is applied, which is followed by LZ77 compression. The advantage that GIF (graphics interchange format) holds over PNG (portable network graphics), is that GIF supports multiple images in one file. MNG is an extension of PNG that supports multiple images in one file. GIF, PNG, and MNG (multiple-image network graphics) are primarily used for graphics compression. To compress larger, photographic images, JPEG (joint photographic experts group) is often more suitable.

457 7.8 Data Compression Photographic images incorporate a great deal of information. However, much of that information can be lost without objectionable deterioration in image quality. With this in mind, JPEG allows user-selectable image quality, but even at the “best” quality levels, JPEG makes an image file smaller owing to its multiple-step compression algorithm. It’s important to remember that JPEG is lossy, even at the highest quality setting. It should be used only when the loss can be tolerated. The JPEG algorithm is illustrated on the next slide.

458 7.8 JPEG Data Compression

459 Chapter 7 Conclusion I/O systems are critical to the overall performance of a computer system. Amdahl’s Law quantifies this assertion. I/O systems consist of memory blocks, cabling, control circuitry, interfaces, and media. I/O control methods include programmed I/O, interrupt-based I/O, DMA, and channel I/O. Buses require control lines, a clock, and data lines. Timing diagrams specify operational details.

460 Chapter 7 Conclusion Magnetic disk is the principal form of durable storage. Disk performance metrics include seek time, rotational delay, and reliability estimates. Optical disks provide long-term storage for large amounts of data, although access is slow. Magnetic tape is also an archival medium. Recording methods are track-based, serpentine, and helical scan.

461 Chapter 7 Conclusion RAID gives disk systems improved performance and reliability. RAID 3 and RAID 5 are the most common. Many storage systems incorporate data compression. Two approaches to data compression are statistical data compression and dictionary systems. GIF, PNG, MNG, and JPEG are used for image compression.

462 Chapter 7 Homework Due: 10/27/2010 Pages: 332-335
Exercises: 2,4,10,17,18,21,27,28,29.

463 Chapter 8 System Software

464 Chapter 8 Objectives Become familiar with the functions provided by operating systems, programming tools, database software and transaction managers. Understand the role played by each software component in maintaining the integrity of a computer system and its data.

465 8.1 Introduction The biggest and fastest computer in the world is of no use if it cannot efficiently provide beneficial services to its users. Users see the computer through their application programs. These programs are ultimately executed by computer hardware. System software-- in the form of operating systems and middleware-- is the glue that holds everything together.

466 8.2 Operating Systems The evolution of operating systems has paralleled the evolution of computer hardware. As hardware became more powerful, operating systems allowed people to more easily manage the power of the machine. In the days when main memory was measured in kilobytes, and tape drives were the only form of magnetic storage, operating systems were simple resident monitor programs. The resident monitor could only load, execute, and terminate programs.

467 8.2 Operating Systems In the 1960s, hardware has become powerful enough to accommodate multiprogramming, the concurrent execution of more than one task. Multiprogramming is achieved by allocating each process a given portion of CPU time (a timeslice). Interactive multiprogramming systems were called timesharing systems. When a process is taken from the CPU and replaced by another, we say that a context switch has occurred.

468 8.2 Operating Systems Today, multiprocessor systems have become commonplace. They present an array of challenges to the operating system designer, including the manner in which the processors will be synchronized, and how to keep their activities from interfering with each other. Tightly coupled multiprocessor systems share a common memory and the same set of I/O devices. Symmetric multiprocessor systems are tightly coupled and load balanced.

469 8.2 Operating Systems Loosely coupled multiprocessor systems have physically separate memory. These are often called distributed systems. Another type of distributed system is a networked system, which consists of a collection of interconnected, collaborating workstations. Real time operating systems control computers that respond to their environment. Hard real time systems have tight timing constraints, soft real time systems do not.

470 8.2 Operating Systems Personal computer operating systems are designed for ease of use rather than high performance. The idea that revolutionized small computer operating systems was the BIOS (basic input-output operating system) chip that permitted a single operating system to function on different types of small systems. The BIOS takes care of the details involved in addressing divergent peripheral device designs and protocols.

471 8.2 Operating Systems Operating systems having graphical user interfaces were first brought to market in the 1980s. At one time, these systems were considered appropriate only for desktop publishing and games. Today they are seen as technology enablers for users with little formal computer education. Once solely a server operating system, Linux holds the promise of bringing Unix to ordinary desktop systems.

472 8.2 Operating Systems Two operating system components are crucial: The kernel and the system programs. As the core of the operating system, the kernel performs scheduling, synchronization, memory management, interrupt handling and it provides security and protection. Microkernel systems provide minimal functionality, with most services carried out by external programs. Monolithic systems provide most of their services within a single operating system program.

473 8.2 Operating Systems Microkernel systems provide better security, easier maintenance, and portability at the expense of execution speed. Examples are Windows 2000, Mach, and QNX. Symmetric multiprocessor computers are ideal platforms for microkernel operating systems. Monolithic systems give faster execution speed, but are difficult to port from one architecture to another. Examples are Linux, MacOS, and DOS.

474 8.2 Operating Systems Process management lies at the heart of operating system services. The operating system creates processes, schedules their access to resources, deletes processes, and deallocates resources that were allocated during process execution. The operating system monitors the activities of each process to avoid synchronization problems that can occur when processes use shared resources. If processes need to communicate with one another, the operating system provides the services.

475 8.2 Operating Systems The operating system schedules process execution. First, the operating system determines which process shall be granted access to the CPU. This is long-term scheduling. After a number of processes have been admitted, the operating system determines which one will have access to the CPU at any particular moment. This is short-term scheduling. Context switches occur when a process is taken from the CPU and replaced by another process. Information relating to the state of the process is preserved during a context switch.

476 8.2 Operating Systems Short-term scheduling can be nonpreemtive or premptive. In nonpreemptive scheduling, a process has use of the CPU until either it terminates, or must wait for resources that are temporarily unavailable. In preemptive scheduling, each process is allocated a timeslice. When the timeslice expires, a context switch occurs. A context switch can also occur when a higher-priority process needs the CPU.

477 8.2 Operating Systems Four approaches to CPU scheduling are:
First-come, first-served where jobs are serviced in arrival sequence and run to completion if they have all of the resources they need. Shortest job first where the smallest jobs get scheduled first. (The trouble is in knowing which jobs are shortest!) Round robin scheduling where each job is allotted a certain amount of CPU time. A context switch occurs when the time expires. Priority scheduling preempts a job with a lower priority when a higher-priority job needs the CPU.

478 8.3 Protected Environments
In their role as resource managers and protectors, many operating systems provide protected environments that isolate processes, or groups of processes from each other. Three common approaches to establishing protected environments are virtual machines, subsystems, and partitions. These environments simplify system management and control, and can provide emulated machines to enable execution of programs that the system would otherwise be unable to run.

479 8.3 Protected Environments
Virtual machines are a protected environment that presents an image of itself -- or the image of a totally different architecture -- to the processes that run within the environment. A virtual machine is exactly that: an imaginary computer. The underlying real machine is under the control of the kernel. The kernel receives and manages all resource requests that emit from processes running in the virtual environment. The next slide provides an illustration.

480 8.3 Protected Environments

481 8.3 Protected Environments
Subsystems are another type of protected environment. They provide logically distinct environments that can be individually controlled and managed. They can be stopped and started independent on each other. Subsystems can have special purposes, such as controlling I/O or virtual machines. Others partition large application systems to make them more manageable. In many cases, resources must be made visible to the subsystem before they can be accessed by the processes running within it. The next slide provides an illustration.

482 8.3 Protected Environments

483 8.3 Protected Environments
In very large computers, subsystems do not go far enough to establish a protected environment. Logical partitions (LPARs) provide much higher barriers: Processes running within a logical partition have no access to processes running in another partition unless a connection between them (e.g., FTP) is explicitly established. LPARs are an enabling technology for the recent trend of consolidating hundreds of small servers within the confines of a single large system. The next slide provides an illustration.

484 8.3 Protected Environments

485 8.4 Programming Tools Programming tools carry out the mechanics of software creation within the confines of the operating system and hardware environment. Assemblers are the simplest of all programming tools. They translate mnemonic instructions to machine code. Most assemblers carry out this translation in two passes over the source code. The first pass partially assembles the code and builds the symbol table The second pass completes the instructions by supplying values stored in the symbol table.

486 8.4 Programming Tools The output of most assemblers is a stream of relocatable binary code. In relocatable code, operand addresses are relative to where the operating system chooses to load the program. Absolute (nonrelocatable) code is most suitable for device and operating system control programming. When relocatable code is loaded for execution, special registers provide the base addressing. Addresses specified within the program are interpreted as offsets from the base address.

487 8.4 Programming Tools The process of assigning physical addresses to program variables is called binding. Binding can occur at compile time, load time, or run time. Compile time binding gives us absolute code. Load time binding assigns physical addresses as the program is loaded into memory. With load time, binding the program cannot be moved! Run time binding requires a base register to carry out the address mapping.

488 8.4 Programming Tools On most systems, binary instructions must pass through a link editor (or linker) to create an executable module. Link editors incorporate various binary routines into a single executable file as called for by a program’s external symbols. Like assemblers, link editors perform two passes: The first pass creates a symbol table and the second resolves references to the values in the symbol table. The next slide shows this process schematically.

489 8.4 Programming Tools

490 8.4 Programming Tools Dynamic linking is when the link editing is delayed until load time or at run time. External modules are loaded from from dynamic link libraries (DLLs). Load time dynamic linking slows down program loading, but calls to the DLLs are faster. Run time dynamic linking occurs when an external module is first called, causing slower execution time. Dynamic linking makes program modules smaller, but carries the risk that the programmer may not have control over the DLL.

491 8.4 Programming Tools Assembly language is considered a “second generation” programming language (2GL). Compiled programming languages, such as C, C++, Pascal, and COBOL, are “third generation” languages (3GLs). Each language generation presents problem solving tools that are closer to how people think and farther away from how the machine implements the solution.

492 Keep in mind that the computer can understand only the 1GL!
8.4 Programming Tools Keep in mind that the computer can understand only the 1GL!

493 8.4 Programming Tools Compilers bridge the semantic gap between the higher level language and the machine’s binary instructions. Most compilers effect this translation in a six-phase process. The first three are analysis phases: 1. Lexical analysis extracts tokens, e.g., reserved words and variables. 2. Syntax analysis (parsing) checks statement construction. 3. Semantic analysis checks data types and the validity of operators.

494 8.4 Programming Tools The last three compiler phases are synthesis phases: 4. Intermediate code generation creates three address code to facilitate optimization and translation. 5. Optimization creates assembly code while taking into account architectural features that can make the code efficient. 6. Code generation creates binary code from the optimized assembly code. Through this modularity, compilers can be written for various platforms by rewriting only the last two phases. The next slide shows this process graphically.

495 8.4 Programming Tools

496 8.4 Programming Tools Interpreters produce executable code from source code in real time, one line at a time. Consequently, this not only makes interpreted languages slower than compiled languages but it also affords less opportunity for error checking. Interpreted languages are, however, very useful for teaching programming concepts, because feedback is nearly instantaneous, and performance is rarely a concern.

497 8.5 Java: All of the Above The Java programming language exemplifies many of the concepts that we have discussed in this chapter. Java programs (classes) execute within a virtual machine, the Java Virtual Machine (JVM). This allows the language to run on any platform for which a virtual machine environment has been written. Java is both a compiled and an interpreted language. The output of the compilation process is an assembly-like intermediate code (bytecode) that is interpreted by the JVM.

498 8.5 Java: All of the Above The JVM is an operating system in miniature. It loads programs, links them, starts execution threads, manages program resources, and deallocates resources when the programs terminate. Because the JVM performs so many tasks at run time, its performance cannot match the performance of a traditional compiled language.

499 8.6 Database Software Database systems contain the most valuable assets of an enterprise. They are the foundation upon which application systems are built.

500 8.6 Database Software Database systems provide a single definition, the database schema, for the data elements that are accessed by application programs. A physical schema is the computer’s view of the database that includes locations of physical files and indexes. A logical schema is the application program’s view of the database that defines field sizes and data types. Within the logical schema, certain data fields are designated as record keys that provide efficient access to records in the database.

501 8.6 Database Software Keys are stored in physical index file structures containing pointers to the location of the physical records. Many implementations use a variant of a B+ tree for index management because B+ trees can be optimized with consideration to the I/O system and the applications. In many cases, the “higher” nodes of the tree will persist in cache memory, requiring physical disk accesses only when traversing the lower levels of the index.

502 8.6 Database Software Most database systems also include transaction management components to assure that the database is always in a consistent state. Transaction management provides the following properties: Atomicity - All related updates occur or no updates occur. Consistency - All updates conform to defined data constraints. Isolation - No transaction can interfere with another transaction. Durability - Successful updates are written to durable media as soon as possible. These are the ACID properties of transaction management.

503 8.6 Database Software Without the ACID properties, race conditions can occur:

504 8.6 Database Software Record locking mechanisms assure isolated, atomic database updates:

505 8.7 Transaction Managers One way to improve database performance is to ask it to do less work by moving some of its functions to specialized software. Transaction management is one component that is often partitioned from the core database system. Transaction managers are especially important when the transactions involve more than one physical database, or the application system spans more than one class of computer, as in a multitiered architecture. One of the most widely-used transaction management systems is CICS shown on the next slide.

506 8.7 Transaction Managers

507 Chapter 8 Conclusion The proper functioning and performance of a computer system depends as much on its software as its hardware. The operating system is the system software component upon which all other software rests. Operating systems control process execution, resource management, protection, and security. Subsystems and partitions provide compatibility and ease of management.

508 Chapter 8 Conclusion Programming languages are often classed into generations, with assembly language being the first generation. All languages above the machine level must be translated into machine code. Compilers bridge this semantic gap through a series of six steps. Link editors resolve system calls and external routines, creating a unified executable module.

509 Chapter 8 Conclusion The Java programming language incorporates the idea of a virtual machine, a compiler and an interpreter. Database software provides controlled access to data files through enforcement of ACID properties. Transaction managers provide high performance and cross-platform access to data.

510 Chapter 8 Homework Due: 11/3/2010 Pages: 407-408
Exercises: 2,3,4,10,11,13,15,21,24.

511 Alternative Architectures
Chapter 9 Alternative Architectures

512 Chapter 9 Objectives Learn the properties that often distinguish RISC from CISC architectures. Understand how multiprocessor architectures are classified. Appreciate the factors that create complexity in multiprocessor systems. Become familiar with the ways in which some architectures transcend the traditional von Neumann paradigm.

513 9.1 Introduction We have so far studied only the simplest models of computer systems; classical single-processor von Neumann systems. This chapter presents a number of different approaches to computer organization and architecture. Some of these approaches are in place in today’s commercial systems. Others may form the basis for the computers of tomorrow.

514 9.2 RISC Machines The underlying philosophy of RISC machines is that a system is better able to manage program execution when the program consists of only a few different instructions that are the same length and require the same number of clock cycles to decode and execute. RISC systems access memory only with explicit load and store instructions. In CISC systems, many different kinds of instructions access memory, making instruction length variable and fetch-decode-execute time unpredictable.

515 9.2 RISC Machines The difference between CISC and RISC becomes evident through the basic computer performance equation: RISC systems shorten execution time by reducing the clock cycles per instruction. CISC systems improve performance by reducing the number of instructions per program.

516 9.2 RISC Machines The simple instruction set of RISC machines enables control units to be hardwired for maximum speed. The more complex-- and variable-- instruction set of CISC machines requires microcode-based control units that interpret instructions as they are fetched from memory. This translation takes time. With fixed-length instructions, RISC lends itself to pipelining and speculative execution.

517 9.2 RISC Machines Consider the the program fragments:
The total clock cycles for the CISC version might be: (2 movs  1 cycle) + (1 mul  30 cycles) = 32 cycles While the clock cycles for the RISC version is: (3 movs  1 cycle) + (5 adds  1 cycle) + (5 loops  1 cycle) = 13 cycles With RISC clock cycle being shorter, RISC gives us much faster execution speeds. mov ax, 0 mov bx, 10 mul cx, 5 Begin add ax, bx loop Begin mov ax, 10 mov bx, 5 mul bx, ax CISC RISC

518 9.2 RISC Machines Because of their load-store ISAs, RISC architectures require a large number of CPU registers. These register provide fast access to data during sequential program execution. They can also be employed to reduce the overhead typically caused by passing parameters to subprograms. Instead of pulling parameters off of a stack, the subprogram is directed to use a subset of registers.

519 9.2 RISC Machines This is how registers can be overlapped in a RISC system. The current window pointer (CWP) points to the active register window.

520 9.3 Flynn’s Taxonomy Many attempts have been made to come up with a way to categorize computer architectures. Flynn’s Taxonomy has been the most enduring of these, despite having some limitations. Flynn’s Taxonomy takes into consideration the number of processors and the number of data paths incorporated into an architecture. A machine can have one or many processors that operate on one or many data streams.

521 9.3 Flynn’s Taxonomy The four combinations of multiple processors and multiple data paths are described by Flynn as: SISD: Single instruction stream, single data stream. These are classic uniprocessor systems. SIMD: Single instruction stream, multiple data streams. Execute the same instruction on multiple data values, as in vector processors. MIMD: Multiple instruction streams, multiple data streams. These are today’s parallel architectures. MISD: Multiple instruction streams, single data stream.

522 9.3 Flynn’s Taxonomy Flynn’s Taxonomy falls short in a number of ways:
First, there appears to be no need for MISD machines. Second, parallelism is not homogeneous. This assumption ignores the contribution of specialized processors. Third, it provides no straightforward way to distinguish architectures of the MIMD category. One idea is to divide these systems into those that share memory, and those that don’t, as well as whether the interconnections are bus-based or switch-based.

523 9.3 Flynn’s Taxonomy Symmetric multiprocessors (SMP) and massively parallel processors (MPP) are MIMD architectures that differ in how they use memory. SMP systems share the same memory and MPP do not. An easy way to distinguish SMP from MPP is: MPP  many processors + distributed memory + communication via network SMP  fewer processors + shared memory communication via memory

524 9.3 Flynn’s Taxonomy Other examples of MIMD architectures are found in distributed computing, where processing takes place collaboratively among networked computers. A network of workstations (NOW) uses otherwise idle systems to solve a problem. A collection of workstations (COW) is a NOW where one workstation coordinates the actions of the others. A dedicated cluster parallel computer (DCPC) is a group of workstations brought together to solve a specific problem. A pile of PCs (POPC) is a cluster of (usually) heterogeneous systems that form a dedicated parallel system.

525 9.3 Flynn’s Taxonomy Flynn’s Taxonomy has been expanded to include SPMD (single program, multiple data) architectures. Each SPMD processor has its own data set and program memory. Different nodes can execute different instructions within the same program using instructions similar to: If myNodeNum = 1 do this, else do that Yet another idea missing from Flynn’s is whether the architecture is instruction driven or data driven. The next slide provides a revised taxonomy.

526 9.3 Flynn’s Taxonomy

527 9.4 Parallel and Multiprocessor Architectures
Parallel processing is capable of economically increasing system throughput while providing better fault tolerance. The limiting factor is that no matter how well an algorithm is parallelized, there is always some portion that must be done sequentially. Additional processors sit idle while the sequential work is performed. Thus, it is important to keep in mind that an n -fold increase in processing power does not necessarily result in an n -fold increase in throughput.

528 9.4 Parallel and Multiprocessor Architectures
Recall that pipelining divides the fetch-decode-execute cycle into stages that each carry out a small part of the process on a set of instructions. Ideally, an instruction exits the pipeline during each tick of the clock. Superpipelining occurs when a pipeline has stages that require less than half a clock cycle to complete. The pipeline is equipped with a separate clock running at a frequency that is at least double that of the main system clock. Superpipelining is only one aspect of superscalar design.

529 9.4 Parallel and Multiprocessor Architectures
Superscalar architectures include multiple execution units such as specialized integer and floating-point adders and multipliers. A critical component of this architecture is the instruction fetch unit, which can simultaneously retrieve several instructions from memory. A decoding unit determines which of these instructions can be executed in parallel and combines them accordingly. This architecture also requires compilers that make optimum use of the hardware.

530 9.4 Parallel and Multiprocessor Architectures
Very long instruction word (VLIW) architectures differ from superscalar architectures because the VLIW compiler, instead of a hardware decoding unit, packs independent instructions into one long instruction that is sent down the pipeline to the execution units. One could argue that this is the best approach because the compiler can better identify instruction dependencies. However, compilers tend to be conservative and cannot have a view of the run time code.

531 9.4 Parallel and Multiprocessor Architectures
Vector computers are processors that operate on entire vectors or matrices at once. These systems are often called supercomputers. Vector computers are highly pipelined so that arithmetic instructions can be overlapped. Vector processors can be categorized according to how operands are accessed. Register-register vector processors require all operands to be in registers. Memory-memory vector processors allow operands to be sent from memory directly to the arithmetic units.

532 9.4 Parallel and Multiprocessor Architectures
A disadvantage of register-register vector computers is that large vectors must be broken into fixed-length segments so they will fit into the register sets. Memory-memory vector computers have a longer startup time until the pipeline becomes full. In general, vector machines are efficient because there are fewer instructions to fetch, and corresponding pairs of values can be prefetched because the processor knows it will have a continuous stream of data.

533 9.4 Parallel and Multiprocessor Architectures
MIMD systems can communicate through shared memory or through an interconnection network. Interconnection networks are often classified according to their topology, routing strategy, and switching technique. Of these, the topology is a major determining factor in the overhead cost of message passing. Message passing takes time owing to network latency and incurs overhead in the processors.

534 9.4 Parallel and Multiprocessor Architectures
Interconnection networks can be either static or dynamic. Processor-to-memory connections usually employ dynamic interconnections. These can be blocking or nonblocking. Nonblocking interconnections allow connections to occur simultaneously. Processor-to-processor message-passing interconnections are usually static, and can employ any of several different topologies, as shown on the following slide.

535 9.4 Parallel and Multiprocessor Architectures

536 9.4 Parallel and Multiprocessor Architectures
Dynamic routing is achieved through switching networks that consist of crossbar switches or 2  2 switches.

537 9.4 Parallel and Multiprocessor Architectures
Multistage interconnection (or shuffle) networks are the most advanced class of switching networks. They can be used in loosely-coupled distributed systems, or in tightly-coupled processor-to-memory configurations.

538 9.4 Parallel and Multiprocessor Architectures
There are advantages and disadvantages to each switching approach. Bus-based networks, while economical, can be bottlenecks. Parallel buses can alleviate bottlenecks, but are costly. Crossbar networks are nonblocking, but require n2 switches to connect n entities. Omega networks are blocking networks, but exhibit less contention than bus-based networks. They are somewhat more economical than crossbar networks, n nodes needing log2n stages with n / 2 switches per stage.

539 9.4 Parallel and Multiprocessor Architectures
Tightly-coupled multiprocessor systems use the same memory. They are also referred to as shared memory multiprocessors. The processors do not necessarily have to share the same block of physical memory: Each processor can have its own memory, but it must share it with the other processors. Configurations such as these are called distributed shared memory multiprocessors.

540 9.4 Parallel and Multiprocessor Architectures
Shared memory MIMD machines can be divided into two categories based upon how they access memory. In uniform memory access (UMA) systems, all memory accesses take the same amount of time. To realize the advantages of a multiprocessor system, the interconnection network must be fast enough to support multiple concurrent accesses to memory, or it will slow down the whole system. Thus, the interconnection network limits the number of processors in a UMA system.

541 9.4 Parallel and Multiprocessor Architectures
The other category of MIMD machines are the nonuniform memory access (NUMA) systems. While NUMA machines see memory as one contiguous addressable space, each processor gets its own piece of it. Thus, a processor can access its own memory much more quickly than it can access memory that is elsewhere. Not only does each processor have its own memory, it also has its own cache, a configuration that can lead to cache coherence problems.

542 9.4 Parallel and Multiprocessor Architectures
Cache coherence problems arise when main memory data is changed and the cached image is not. (We say that the cached value is stale.) To combat this problem, some NUMA machines are equipped with snoopy cache controllers that monitor all caches on the systems. These systems are called cache coherent NUMA (CC-NUMA) architectures. A simpler approach is to ask the processor having the stale value to either void the stale cached value or to update it with the new value.

543 9.4 Parallel and Multiprocessor Architectures
When a processor’s cached value is updated concurrently with the update to memory, we say that the system uses a write-through cache update protocol. If the write-through with update protocol is used, a message containing the update is broadcast to all processors so that they may update their caches. If the write-through with invalidate protocol is used, a broadcast asks all processors to invalidate the stale cached value.

544 9.4 Parallel and Multiprocessor Architectures
Write-invalidate uses less bandwidth because it uses the network only the first time the data is updated, but retrieval of the fresh data takes longer. Write-update creates more message traffic, but all caches are kept current. Another approach is the write-back protocol that delays an update to memory until the modified cache block must be replaced. At replacement time, the processor writing the cached value must obtain exclusive rights to the data. When rights are granted, all other cached copies are invalidated.

545 9.4 Parallel and Multiprocessor Architectures
Distributed computing is another form of multiprocessing. However, the term distributed computing means different things to different people. In a sense, all multiprocessor systems are distributed systems because the processing load is distributed among processors that work collaboratively. The common understanding is that a distributed system consists of very loosely-coupled processing units. Recently, NOWs have been used as distributed systems to solve large, intractable problems.

546 9.4 Parallel and Multiprocessor Architectures
For general-use computing, the details of the network and the nature of the multiplatform computing should be transparent to the users of the system. Remote procedure calls (RPCs) enable this transparency. RPCs use resources on remote machines by invoking procedures that reside and are executed on the remote machines. RPCs are employed by numerous vendors of distributed computing architectures including the Common Object Broker Architecture (CORBA) and Java’s Remote Method Invocation (RMI).

547 9.5 Alternative Parallel Processing Approaches
Some people argue that real breakthroughs in computational power-- breakthroughs that will enable us to solve today’s intractable problems-- will occur only by abandoning the von Neumann model. Numerous efforts are now underway to devise systems that could change the way that we think about computers and computation. In this section, we will look at three of these: dataflow computing, neural networks, and systolic processing.

548 9.5 Alternative Parallel Processing Approaches
Von Neumann machines exhibit sequential control flow: A linear stream of instructions is fetched from memory, and they act upon data. Program flow changes under the direction of branching instructions. In dataflow computing, program control is directly controlled by data dependencies. There is no program counter or shared storage. Data flows continuously and is available to multiple instructions simultaneously.

549 9.5 Alternative Parallel Processing Approaches
A data flow graph represents the computation flow in a dataflow computer. Its nodes contain the instructions and its arcs indicate the data dependencies.

550 9.5 Alternative Parallel Processing Approaches
When a node has all of the data tokens it needs, it fires, performing the required operating, and consuming the token. The result is placed on an output arc.

551 9.5 Alternative Parallel Processing Approaches
A dataflow program to calculate n! and its corresponding graph are shown below. (initial j <- n; k <- 1 while j > 1 do new k<- * j; new j <- j - 1; return k)

552 9.5 Alternative Parallel Processing Approaches
The architecture of a dataflow computer consists of processing elements that communicate with one another. Each processing element has an enabling unit that sequentially accepts tokens and stored them in memory. If the node to which this token is addressed fires, the input tokens are extracted from memory and are combined with the node itself to form an executable packet.

553 9.5 Alternative Parallel Processing Approaches
Using the executable packet, the processing element’s functional unit computes any output values and combines them with destination addresses to form more tokens. The tokens are then sent back to the enabling unit, optionally enabling other nodes. Because dataflow machines are data driven, multiprocessor dataflow architectures are not subject to the cache coherency and contention problems that plague other multiprocessor systems.

554 9.5 Alternative Parallel Processing Approaches
Neural network computers consist of a large number of simple processing elements that individually solve a small piece of a much larger problem. They are particularly useful in dynamic situations that are an accumulation of previous behavior, and where an exact algorithmic solution cannot be formulated. Like their biological analogues, neural networks can deal with imprecise, probabilistic information, and allow for adaptive interactions.

555 9.5 Alternative Parallel Processing Approaches
Neural network processing elements (PEs) multiply a set of input values by an adaptable set of weights to yield a single output value. The computation carried out by each PE is simplistic-- almost trivial-- when compared to a traditional microprocessor. Their power lies in their massively parallel architecture and their ability to adapt to the dynamics of the problem space. Neural networks learn from their environments. A built-in learning algorithm directs this process.

556 9.5 Alternative Parallel Processing Approaches
The simplest neural net PE is the perceptron. Perceptrons are trainable neurons. A perceptron produces a Boolean output based upon the values that it receives from several inputs.

557 9.5 Alternative Parallel Processing Approaches
Perceptrons are trainable because the threshold and input weights are modifiable. In this example, the output Z is true (1) if the net input, w1x1 + w2x wnxn is greater than the threshold T.

558 9.5 Alternative Parallel Processing Approaches
Perceptrons are trained by use of supervised or unsupervised learning. Supervised learning assumes prior knowledge of correct results which are fed to the neural net during the training phase. If the output is incorrect, the network modifies the input weights to produce correct results. Unsupervised learning does not provide correct results during training. The network adapts solely in response to inputs, learning to recognize patterns and structure in the input sets.

559 9.5 Alternative Parallel Processing Approaches
The biggest problem with neural nets is that when they consist of more than 10 or 20 neurons, it is impossible to understand how the net is arriving at its results. They can derive meaning from data that are too complex to be analyzed by people. The U.S. military once used a neural net to try to locate camouflaged tanks in a series of photographs. It turned out that the nets were basing their decisions on the cloud cover instead of the presence or absence of the tanks. Despite early setbacks, neural nets are gaining credibility in sales forecasting, data validation, and facial recognition.

560 9.5 Alternative Parallel Processing Approaches
Where neural nets are a model of biological neurons, systolic array computers are a model of how blood flows through a biological heart. Systolic arrays, a variation of SIMD computers, have simple processors that process data by circulating it through vector pipelines.

561 9.5 Alternative Parallel Processing Approaches
Systolic arrays can sustain great throughout because they employ a high degree of parallelism. Connections are short, and the design is simple and scalable. They are robust, efficient, and cheap to produce. They are, however, highly specialized and limited as to they types of problems they can solve. They are useful for solving repetitive problems that lend themselves to parallel solutions using a large number of simple processing elements. Examples include sorting, image processing, and Fourier transformations.

562 Chapter 9 Conclusion The common distinctions between RISC and CISC systems include RISC’s short, fixed-length instructions. RISC ISAs are load-store architectures. These things permit RISC systems to be highly pipelined. Flynn’s Taxonomy provides a way to classify multiprocessor systems based upon the number of processors and data streams. It falls short of being an accurate depiction of today’s systems.

563 Chapter 9 Conclusion Massively parallel processors have many processors, distributed memory, and computational elements communicate through a network. Symmetric multiprocessors have fewer processors and communicate through shared memory. Characteristics of superscalar design include superpipelining, and specialized instruction fetch and decoding units.

564 Chapter 9 Conclusion Very long instruction word (VLIW) architectures differ from superscalar architectures because the compiler, instead of a decoding unit, creates long instructions. Vector computers are highly-pipelined processors that operate on entire vectors or matrices at once. MIMD systems communicate through networks that can be blocking or nonblocking. The network topology often determines throughput.

565 Chapter 9 Conclusion Multiprocessor memory can be distributed or exist in a single unit. Distributed memory brings to rise problems with cache coherency that are addressed using cache coherency protocols. New architectures are being devised to solve intractable problems. These new architectures include dataflow computers, neural networks, and systolic arrays.

566 Chapter 9 Homework Due: 11/17/2010 Pages: 446-449
Exercises: 2,8,12,15,18,24, 26,28,32,33.

567 Performance Measurement and Analysis
Chapter 10 Performance Measurement and Analysis

568 Chapter 10 Objectives Understand the ways in which computer performance is measured. Be able to describe common benchmarks and their limitations. Become familiar with factors that contribute to improvements in CPU and disk performance.

569 10.1 Introduction The ideas presented in this chapter will help you to understand various measurements of computer performance. You will be able to use these ideas when you are purchasing a large system, or trying to improve the performance of an existing system. We will discuss a number of factors that affect system performance, including some tips that you can use to improve the performance of programs.

570 10.2 The Basic Computer Performance Equation
The basic computer performance equation has been useful in our discussions of RISC versus CISC: To achieve better performance, RISC machines reduce the number of cycles per instruction, and CISC machines reduce the number of instructions per program.

571 10.2 The Basic Computer Performance Equation
We have also learned that CPU efficiency is not the sole factor in overall system performance. Memory and I/O performance are also important. Amdahl’s Law tells us that the system performance gain realized from the speedup of one component depends not only on the speedup of the component itself, but also on the fraction of work done by the component:

572 10.2 The Basic Computer Performance Equation
In short, Amdahl’s Law tells us to make the common case fast. So if our system is CPU bound, we want to make the CPU faster. A memory bound system calls for improvements in memory management. The performance of an I/O bound system will improve with an upgrade to the I/O system. Of course, fixing a performance problem in one part of the system can expose a weakness in another part of the system!

573 10.3 Mathematical Preliminaries
Measures of system performance depend upon one’s point of view. A computer user is most often concerned with response time: How long does it take the system to carry out a task? System administrators are usually more concerned with throughput: How many concurrent tasks can the system handle before response time is adversely affected? These two ideas are related: If a system carries out a task in k seconds, then its throughput is 1/k of these tasks per second.

574 10.3 Mathematical Preliminaries
In comparing the performance of two systems, we measure the time that it takes for each system to do the same amount of work. Specifically, if System A and System B run the same program, System A is n times as fast as System B if: System A is x% faster than System B if:

575 10.3 Mathematical Preliminaries
Suppose we have two racecars that have just completed a 10 mile race. Car A finished in 3 minutes, and Car B finished in 4 minutes. Using our formulas, Car A is 1.25 times as fast as Car B, and Car A is also 25% faster than Car B:

576 10.3 Mathematical Preliminaries
When we are evaluating system performance we are most interested in its expected performance under a given workload. We use statistical tools that are measures of central tendency. The one with which everyone is most familiar is the arithmetic mean (or average), given by:

577 10.3 Mathematical Preliminaries
The arithmetic mean can be misleading if the data are skewed or scattered. Consider the execution times given in the table below. The performance differences are hidden by the simple average.

578 10.3 Mathematical Preliminaries
If execution frequencies (expected workloads) are known, a weighted average can be revealing. The weighted average for System A is: 50      0.05 = 380.

579 10.3 Mathematical Preliminaries
However, workloads can change over time. A system optimized for one workload may perform poorly when the workload changes, as illustrated below.

580 10.3 Mathematical Preliminaries
When comparing the relative performance of two or more systems, the geometric mean is the preferred measure of central tendency. It is the nth root of the product of n measurements. Unlike the arithmetic means, the geometric mean does not give us a real expectation of system performance. It serves only as a tool for comparison.

581 10.3 Mathematical Preliminaries
The geometric mean is often uses normalized ratios between a system under test and a reference machine. We have performed the calculation in the table below.

582 10.3 Mathematical Preliminaries
When another system is used for a reference machine, we get a different set of numbers.

583 10.3 Mathematical Preliminaries
The real usefulness of the normalized geometric mean is that no matter which system us used as a reference, the ratio of the geometric means is consistent. This is to say that the ratio of the geometric means for System A to System B, System B to System C, and System A to System C is the same no matter which machine is the reference machine.

584 10.3 Mathematical Preliminaries
The results that we got when using System B and System C as reference machines are given below. We find that /1 = /

585 10.3 Mathematical Preliminaries
The inherent problem with using the geometric mean to demonstrate machine performance is that all execution times contribute equally to the result. So shortening the execution time of a small program by 10% has the same effect as shortening the execution time of a large program by 10%. Shorter programs are generally easier to optimize, but in the real world, we want to shorten the execution time of longer programs. Also, if the geometric mean is not proportionate. A system giving a geometric mean 50% smaller than another is not necessarily twice as fast!

586 10.3 Mathematical Preliminaries
The harmonic mean provides us with the means to compare execution times that are expressed as a rate. The harmonic mean allows us to form a mathematical expectation of throughput, and to compare the relative throughput of systems and system components. To find the harmonic mean, we add the reciprocals of the rates and divide them into the number of rates: H = n  (1/x1+1/x2+1/x /xn)

587 10.3 Mathematical Preliminaries
The harmonic mean holds two advantages over the geometric mean. First, it is a suitable predictor of machine behavior. So it is useful for more than simply comparing performance. Second, the slowest rates have the greater influence on the result, so improving the slowest performance-- usually what we want to do-- results in better performance. The main disadvantage is that the geometric mean is sensitive to the choice of a reference machine.

588 10.3 Mathematical Preliminaries
The chart below summarizes when the use of each of the performance means is appropriate.

589 10.3 Mathematical Preliminaries
The objective assessment of computer performance is most critical when deciding which one to buy. For enterprise-level systems, this process is complicated, and the consequences of a bad decision are grave. Unfortunately, computer sales are as much dependent on good marketing as on good performance. The wary buyer will understand how objective performance data can be slanted to the advantage of anyone giving a sales pitch.

590 10.3 Mathematical Preliminaries
The most common deceptive practices include: Selective statistics: Citing only favorable results while omitting others. Citing only peak performance numbers while ignoring the average case. Vagueness in the use of words like “almost,” “nearly,” “more,” and “less,” in comparing performance data. The use of inappropriate statistics or “comparing apples to oranges.” Implying that you should buy a particular system because “everyone” is buying similar systems. Many examples can be found in business and trade journal ads.

591 10.4 Benchmarking Performance benchmarking is the science of making objective assessments concerning the performance of one system over another. Price-performance ratios can be derived from standard benchmarks. The troublesome issue is that there is no definitive benchmark that can tell you which system will run your applications the fastest (using the least wall clock time) for the least amount of money.

592 10.4 Benchmarking Many people erroneously equate CPU speed with performance. Measures of CPU speed include cycle time (MHz, and GHz) and millions of instructions per second (MIPS). Saying that System A is faster than System B because System A runs at 1.4GHz and System B runs at 900MHz is valid only when the ISAs of Systems A and B are identical. With different ISAs, it is possible that both of these systems could obtain identical results within the same amount of wall clock time.

593 10.4 Benchmarking In an effort to describe performance independent of clock speed and ISAs, a number of synthetic benchmarks have been attempted over the years. Synthetic benchmarks are programs that serve no purpose except to produce performance numbers. The earliest synthetic benchmarks, Whetstone, Dhrystone, and Linpack (to name only a few) were relatively small programs that were easy to optimize. This fact limited their usefulness from the outset. These programs are much too small to be useful in evaluating the performance of today’s systems.

594 10.4 Benchmarking In 1988 the Standard Performance Evaluation Corporation (SPEC) was formed to address the need for objective benchmarks. SPEC produces benchmark suites for various classes of computers and computer applications. Their most widely known benchmark suite is the SPEC CPU benchmark. The SPEC2000 benchmark consists of two parts, CINT2000, which measures integer arithmetic operations, and CFP2000, which measures floating-point processing.

595 10.4 Benchmarking The SPEC benchmarks consist of a collection of kernel programs. These are programs that carry out the core processes involved in solving a particular problem. Activities that do not contribute to solving the problem, such as I/O are removed. CINT2000 consists of 12 applications (11 written in C and one in C++); CFP2000 consists of 14 applications (6 FORTRAN 77, 4 FORTRAN 90, and 4 C). A list of these programs can be found in Table 10.7 on Pages

596 10.4 Benchmarking On most systems, more than two 24 hour days are required to run the SPEC CPU2000 benchmark suite. Upon completion, the execution time for each kernel (as reported by the benchmark suite) is divided by the run time for the same kernel on a Sun Ultra 10. The final result is the geometric mean of all of the run times. Manufacturers may report two sets of numbers: The peak and base numbers are the results with and without compiler optimization flags, respectively.

597 10.4 Benchmarking The SPEC CPU benchmark evaluates only CPU performance. When the performance of the entire system under high transaction loads is a greater concern, the Transaction Performance Council (TPC) benchmarks are more suitable. The current version of this suite is the TPC-C benchmark. TPC-C models the transactions typical of a warehousing business using terminal emulation software.

598 10.4 Benchmarking The TPC-C metric is the number of new warehouse order transactions per minute (tpmC), while a mix of other transactions is concurrently running on the system. The tpmC result is divided by the total cost of the configuration tested to give a price-performance ratio. The price of the system includes all hardware, software, and maintenance fees that the customer would expect to pay.

599 10.4 Benchmarking The Transaction Performance Council has also devised benchmarks for decision support systems (used for applications such as data mining) and for Web-based e-commerce systems. For all of its benchmarks, the systems tested must be available for general sale at the time of the test and at the prices cited in a full disclosure report. Results of the tests are audited by an independent auditing firm that has been certified by the TPC.

600 10.4 Benchmarking TPC benchmarks are a kind of simulation tool.
They can be used to optimize system performance under varying conditions that occur rarely under normal conditions. Other kinds of simulation tools can be devised to assess performance of an existing system, or to model the performance of systems that do not yet exist. One of the greatest challenges in creation of a system simulation tool is in coming up with a realistic workload.

601 10.4 Benchmarking To determine the workload for a particular system component, system traces are sometimes used. Traces are gathered by using hardware or software probes that collect detailed information concerning the activity of a component of interest. Because of the enormous amount of detailed information collected by probes, they are usually engaged for a few seconds. Several trace runs may be required to obtain statistically useful system information.

602 10.4 Benchmarking Devising a good simulator requires that one keep a clear focus as to the purpose of the simulator A model that is too detailed is costly and time-consuming to write. Conversely, it is of little use to create a simulator that is so simplistic that it ignores important details of the system being modeled. A simulator should be validated to show that it is achieving the goal that it set out to do: A simple simulator is easier to validate than a complex one.

603 10.5 CPU Performance Optimization
CPU optimization includes many of the topics that have been covered in preceding chapters. CPU optimization includes topics such as pipelining, parallel execution units, and integrated floating-point units. We have not yet explored two important CPU optimization topics: Branch optimization and user code optimization. Both of these can affect performance in dramatic ways.

604 10.5 CPU Performance Optimization
We know that pipelines offer significant execution speedup when the pipeline is kept full. Conditional branch instructions are a type of pipeline hazard that can result in flushing the pipeline. Other hazards are include conflicts, data dependencies, and memory access delays. Delayed branching offers one way of dealing with branch hazards. With delayed branching, one or more instructions following a conditional branch are sent down the pipeline regardless of the outcome of the statement.

605 10.5 CPU Performance Optimization
The responsibility for setting up delayed branching most often rests with the compiler. It can choose the instruction to place in the delay slot in a number of ways. The first choice is a useful instruction that executes regardless of whether the branch occurs. Other possibilities include instructions that execute if the branch occurs, but do no harm if the branch does not occur. Delayed branching has the advantage of low hardware cost.

606 10.5 CPU Performance Optimization
Branch prediction is another approach to minimizing branch penalties. Branch prediction tries to avoid pipeline stalls by guessing the next instruction in the instruction stream. This is called speculative execution. Branch prediction techniques vary according to the type of branching. If/then/else, loop control, and subroutine branching all have different execution profiles.

607 10.5 CPU Performance Optimization
There are various ways in which a prediction can be made: Fixed predictions do not change over time. True predictions result in the branch being always taken or never taken. Dynamic prediction uses historical information about the branch and its outcomes. Static prediction does not use any history.

608 10.5 CPU Performance Optimization
When fixed prediction assumes that a branch is not taken, the normal sequential path of the program is taken. However, processing is done in parallel in case the branch occurs. If the prediction is correct, the preprocessing information is deleted. If the prediction is incorrect, the speculative processing is deleted and the preprocessing information is used to continue on the correct path.

609 10.5 CPU Performance Optimization
When fixed prediction assumes that a branch is always taken, state information is saved before the speculative processing begins. If the prediction is correct, the saved information is deleted. If the prediction is incorrect, the speculative processing is deleted and the saved information is restored allowing execution to continue to continue on the correct path.

610 10.5 CPU Performance Optimization
Dynamic prediction employs a high-speed branch prediction buffer to combine an instruction with its history. The buffer is indexed by the lower portion of the address of the branch instruction that also contains extra bits indicating whether the branch was recently taken. One-bit dynamic prediction uses a single bit to indicate whether the last occurrence of the branch was taken. Two-bit branch prediction retains the history of the previous to occurrences of the branch along with a probability of the branch being taken.

611 10.5 CPU Performance Optimization
The earliest branch prediction implementations used static branch prediction. Most newer processors (including the Pentium, PowerPC, UltraSparc, and Motorola 68060) use two-bit dynamic branch prediction. Some superscalar architectures include branch prediction as a user option. Many systems implement branch prediction in specialized circuits for maximum throughput.

612 10.5 CPU Performance Optimization
The best hardware and compilers will never equal the abilities of a human being who has mastered the science of effective algorithm and coding design. People can see an algorithm in the context of the machine it will run on. For example a good programmer will access a stored column-major array in column-major order. We end this section by offering some tips to help you achieve optimal program performance.

613 10.5 CPU Performance Optimization
Operation counting can enhance program performance. With this method, you count the number of instruction types executed in a loop then determine the number of machine cycles for each instruction. The idea is to provide the best mix of instruction types for a particular architecture. Nested loops provide a number of interesting optimization opportunities.

614 10.5 CPU Performance Optimization
Loop unrolling is the process of expanding a loop so that each new iteration contains several of the original operations, thus performing more computations per loop iteration. For example: becomes for (i = 1; i <= 30; i++) a[i] = a[i] + b[i] * c; for (i = 1; i <= 30; i+=3) { a[i] = a[i] + b[i] * c; a[i+1] = a[i+1] + b[i+1] * c; a[i+2] = a[i+2] + b[i+2] * c; }

615 10.5 CPU Performance Optimization
Loop fusion combines loops that use the same data elements, possibly improving cache performance. For example: becomes for (i = 0; i < N; i++) C[i] = A[i] + B[i]; D[i] = E[i] + C[i]; for (i = 0; i < N; i++) { C[i] = A[i] + B[i]; D[i] = E[i] + C[i]; }

616 10.5 CPU Performance Optimization
Loop fission splits large loops into smaller ones to reduce data dependencies and resource conflicts. A loop fission technique known as loop peeling removes the beginning and ending loop statements. For example: becomes for (i = 1; i < N+1; i++) { if (i==1) A[i] = 0; else if (i == N) A[i] = N; else A[i] = A[i] + 8; } A[1] = 0; for (i = 2; i < N; i++) A[i] = A[i] + 8; A[N] = N;

617 10.5 CPU Performance Optimization
The text lists a number of rules of thumb for getting the most out of program performance. Optimization efforts pay the biggest dividends when they are applied to code segments that are executed the most frequently. In short, try to make the common cases fast.

618 10.6 Disk Performance Optimal disk performance is critical to system throughput. Disk drives are the slowest memory component, with the fastest access times one million times longer than main memory access times. A slow disk system can choke transaction processing and drag down the performance of all programs when virtual memory paging is involved. Low CPU utilization can actually indicate a problem in the I/O subsystem, because the CPU spends more time waiting than running.

619 10.6 Disk Performance Disk utilization is the measure of the percentage of the time that the disk is busy servicing I/O requests. It gives the probability that the disk will be busy when another I/O request arrives in the disk service queue. Disk utilization is determined by the speed of the disk and the rate at which requests arrive in the service queue. Stated mathematically: Utilization = Request Arrival Rate Disk Service Rate. where the arrival rate is given in requests per second, and the disk service rate is given in I/O operations per second (IOPS)

620 10.6 Disk Performance The amount of time that a request spends in the queue is directly related to the service time and the probability that the disk is busy, and it is indirectly related to the probability that the disk is idle. In formula form, we have: Time in Queue = (Service time  Utilization)  (1 – Utilization) The important relationship between queue time and utilization (from the formula above) is shown graphically on the next slide.

621 10.6 Disk Performance The “knee” of the curve is around 78%. This is why 80% is the rule-of-thumb upper limit for utilization for most disk drives. Beyond that, queue time quickly becomes excessive.

622 10.6 Disk Performance The manner in which files are organized on a disk greatly affects throughput. Disk arm motion is the greatest consumer of service time. Disk specifications cite average seek time, which is usually in the range of 5 to 10ms. However, a full-stroke seek can take as long as 15 to 20ms. Clever disk scheduling algorithms endeavor to minimize seek time.

623 10.6 Disk Performance The most naïve disk scheduling policy is first-come, first-served (FCFS). As its name implies, FCFS services all I/O requests in the order in which they arrive in the queue. With this approach, there is no real control over arm motion, so random, wide sweeps across the disk are possible. Performance is unpredictable and variable according to shifts in workload.

624 10.6 Disk Performance Arm motion is reduced when requests are ordered so that the disk arm moves only to the track nearest its current location. This is the idea employed by the shortest seek time first (SSTF) scheduling algorithm. With SSTF, starvation is possible: A track request for a “remote” track could keep getting shoved to the back of the queue nearer requests are serviced. Interestingly, this problem is at its worst with low disk utilization rates.

625 10.6 Disk Performance To avoid the starvation in SSTF, fairness can be enforced by having the disk arm continually sweep over the surface of the disk, stopping when it reaches a track for which it has a request. This approach is called an elevator algorithm. In the context of disk scheduling, the elevator algorithm is known as the SCAN (which is not an acronym). While SCAN entails a lot of arm motion, the motion is constant and predictable.

626 10.6 Disk Performance A SCAN variant, called C-SCAN for circular SCAN, treats track zero as if it is adjacent to the highest-numbered track on the disk. The arm moves in one direction only, providing a simpler SCAN implementation. The disk arm motion of SCAN and C-SCAN is can be reduced through the use of the LOOK and C-LOOK algorithms. Instead of sweeping the entire disk, they travel only to the highest- and lowest-numbered tracks for which they have requests.

627 10.6 Disk Performance At high utilization rates, SSTF performs slightly better than SCAN or LOOK. But the risk of starvation persists. Under very low utilization (under 20%), the performance of any of these algorithms will be acceptable. No matter which scheduling algorithm is used, file placement greatly influences performance. When possible, the most frequently-used files should reside in the center tracks of the disk, and the disk should be periodically defragmented.

628 10.6 Disk Performance The best way to reduce disk arm motion is to avoid using the disk as much as possible. To this end, many disk drives, or disk drive controllers, are provided with cache memory or a number of main memory pages set aside for the exclusive use of the I/O subsystem. Disk cache memory is usually associative. Because associative cache searches are time-consuming, performance can actually be better with smaller disk caches because hit rates are usually low.

629 10.6 Disk Performance The best way to reduce disk arm motion is to avoid using the disk as much as possible. To this end, many disk drives, or disk drive controllers, are provided with cache memory or a number of main memory pages set aside for the exclusive use of the I/O subsystem. Disk cache memory is usually associative. Because associative cache searches are time-consuming, performance can actually be better with smaller disk caches because hit rates are usually low.

630 10.6 Disk Performance Many disk drive-based caches use prefetching techniques to reduce disk accesses. When using prefetching, a disk will read a number of sectors subsequent to the one requested with the expectation that one or more of the subsequent sectors will be needed “soon.” Empirical studies have shown that over 50% of disk accesses are sequential in nature, and that prefetching increases performance by 40%, on average.

631 10.6 Disk Performance Prefetching is subject to cache pollution, which occurs when the cache is filled with data that no process needs, leaving less room for useful data. Various replacement algorithms, LRU, LFU and random, are employed to help keep the cache clean. Additionally, because disk caches serve as a staging area for data to be written to the disk, some disk cache management schemes evict all bytes after they have been written to the disk.

632 10.6 Disk Performance With cached disk writes, we are faced with the problem that cache is volatile memory. In the event of a massive system failure, data in the cache will be lost. An application believes that the data has been committed to the disk, when it really is in the cache. If the cache fails, the data just disappears. To defend against power loss to the cache, some disk controller-based caches are mirrored and supplied with a battery backup.

633 10.6 Disk Performance Another approach to combating cache failure is to employ a write-through cache where a copy of the data is retained in the cache in case it is needed again “soon,” but it is simultaneously written to the disk. The operating system is signaled that the I/O is complete only after the data has actually been placed on the disk. With a write-through cache, performance is somewhat compromised to provide reliability.

634 10.6 Disk Performance When throughput is more important than reliability, a system may employ the write back cache policy. Some disk drives employ opportunistic writes. With this approach, dirty blocks wait in the cache until the arrival of a read request for the same cylinder. The write operation is then “piggybacked” onto the read operation.

635 10.6 Disk Performance Opportunistic writes have the effect of reducing performance on reads, but of improving it for writes. The tradeoffs involved in optimizing disk performance can present difficult choices. Our first responsibility is to assure data reliability and consistency. No matter what its price, upgrading a disk subsystem is always cheaper than replacing lost data.

636 Chapter 10 Conclusion Computer performance assessment relies upon measures of central tendency that include the arithmetic mean, weighted arithmetic mean, the geometric mean, and the harmonic mean. Each of these is applicable under different circumstances. Benchmark suites have been designed to provide objective performance assessment. The most well respected of these are the SPEC and TPC benchmarks.

637 Chapter 10 Conclusion CPU performance depends upon many factors.
These include pipelining, parallel execution units, integrated floating-point units, and effective branch prediction. User code optimization affords the greatest opportunity for performance improvement. Code optimization methods include loop manipulation and good algorithm design.

638 Chapter 10 Conclusion Most systems are heavily dependent upon I/O subsystems. Disk performance can be improved through good scheduling algorithms, appropriate file placement, and caching. Caching provides speed, but involves some risk. Keeping disks defragmented reduces arm motion and results in faster service time.

639 Chapter 10 Homework Due: 11/24/2010 Pages: 495-499
Exercises: 2,5,8,12,16,21,25. Hints: #21 FCFS = 215 tracks × 500 ns + 8 stops × 2 × 106ns = ms.

640 Network Organization and Architecture
Chapter 11 Network Organization and Architecture

641 Chapter 11 Objectives Become familiar with the fundamentals of network architectures. Learn the basic components of a local area network. Become familiar with the general architecture of the Internet.

642 11.1 Introduction The network is a crucial component of today’s computing systems. Resource sharing across networks has taken the form of multitier architectures having numerous disparate servers, sometimes far removed from the users of the system. If you think of a computing system as collection of workstations and servers, then surely the network is the system bus of this configuration.

643 11.2 Early Business Computer Networks
The first computer networks consisted of a mainframe host that was connected to one or more front end processors. Front end processors received input over dedicated lines from remote communications controllers connected to several dumb terminals. The protocols employed by this configuration were proprietary to each vendor’s system. One of these, IBM’s SNA became the model for an international communications standard, the ISO/OSI Reference Model.

644 11.3 Early Academic and Scientific Networks
In the 1960s, the Advanced Research Projects Agency funded research under the auspices of the U.S. Department of Defense. Computers at that time were few and costly. In 1968, the Defense Department funded an interconnecting network to make the most of these precious resources. The network, DARPANet, designed by Bolt, Beranek, and Newman, had sufficient redundancy to withstand the loss of a good portion of the network. DARPANet, later turned over to the public domain, eventually evolved to become today’s Internet.

645 11.4 Network Protocols I ISO/OSI Reference Model
To address the growing tangle of incompatible proprietary network protocols, in 1984 the ISO formed a committee to devise a unified protocol standard. The result of this effort is the ISO Open Systems Interconnect Reference Model (ISO/OSI RM). The ISO’s work is called a reference model because virtually no commercial system uses all of the features precisely as specified in the model. The ISO/OSI model does, however, lend itself to understanding the concept of a unified communications architecture.

646 11.4 Network Protocols I ISO/OSI Reference Model
The OSI RM contains seven protocol layers, starting with physical media interconnections at Layer 1, through applications at Layer 7.

647 11.4 Network Protocols I ISO/OSI Reference Model
OSI model defines only the functions of each of the seven layers and the interfaces between them. Implementation details are not part of the model.

648 11.4 Network Protocols I ISO/OSI Reference Model
The Physical layer receives a stream of bits from the Data Link layer above it, encodes them and places them on the communications medium. The Physical layer conveys transmission frames, called Physical Protocol Data Units, or Physical PDUs. Each physical PDU carries an address and has delimiter signal patterns that surround the payload, or contents, of the PDU.

649 11.4 Network Protocols I ISO/OSI Reference Model
The Data Link layer negotiates frame sizes and the speed at which they are sent with the Data Link layer at the other end. The timing of frame transmission is called flow control. Data Link layers at both ends acknowledge packets as they are exchanged. The sender retransmits the packet if no acknowledgement is received within a given time interval.

650 11.4 Network Protocols I ISO/OSI Reference Model
At the originating computers, the Network layer adds addressing information to the Transport layer PDUs. The Network layer establishes the route and ensures that the PDU size is compatible with all of the equipment between the source and the destination. Its most important job is in moving PDUs across intermediate nodes.

651 11.4 Network Protocols I ISO/OSI Reference Model
the OSI Transport layer provides end-to-end acknowledgement and error correction through its handshaking with the Transport layer at the other end of the conversation. The Transport layer is the lowest layer of the OSI model at which there is any awareness of the network or its protocols. Transport layer assures the Session layer that there are no network-induced errors in the PDU.

652 11.4 Network Protocols I ISO/OSI Reference Model
The Session layer arbitrates the dialogue between two communicating nodes, opening and closing that dialogue as necessary. It controls the direction and mode (half -duplex or full-duplex). It also supplies recovery checkpoints during file transfers. Checkpoints are issued each time a block of data is acknowledged as being received in good condition.

653 11.4 Network Protocols I ISO/OSI Reference Model
The Presentation layer provides high-level data interpretation services for the Application layer above it, such as EBCDIC-to-ASCII translation. Presentation layer services are also called into play if we use encryption or certain types of data compression.

654 11.4 Network Protocols I ISO/OSI Reference Model
The Application layer supplies meaningful information and services to users at one end of the communication and interfaces with system resources (programs and data files) at the other end of the communication. All that applications need to do is to send messages to the Presentation layer, and the lower layers take care of the hard part.

655 11.4 Network Protocols II TCP/IP Architecture
TCP/IP is the de facto global data communications standard. It has a lean 3-layer protocol stack that can be mapped to five of the seven in the OSI model. TCP/IP can be used with any type of network, even different types of networks within a single session.

656 11.4 Network Protocols II TCP/IP Architecture
The IP Layer of the TCP/IP protocol stack provides essentially the same services as the Network and Data Link layers of the OSI Reference Model. It divides TCP packets into protocol data units called datagrams, and then attaches routing information.

657 11.4 Network Protocols II TCP/IP Architecture
The concept of the datagram was fundamental to the robustness of ARPAnet, and now, the Internet. Datagrams can take any route available to them without human intervention.

658 11.4 Network Protocols II TCP/IP Architecture
The current version of IP, IPv4, was never designed to serve millions of network components scattered across the globe. It limitations include 32-bit addresses, a packet length limited to 65,635 bytes, and that all security measures are optional. Furthermore, network addresses have been assigned with little planning which has resulted in slow and cumbersome routing hardware and software. We will see later how these problems have been addressed by IPv6.

659 11.4 Network Protocols II TCP/IP Architecture
Transmission Control Protocol (TCP) is the consumer of IP services. It engages in a conversation-- a connection-- with the TCP process running on the remote system. A TCP connection is analogous to a telephone conversation, with its own protocol "etiquette."

660 11.4 Network Protocols II TCP/IP Architecture
As part of initiating a connection, TCP also opens a service access point (SAP) in the application running above it. In TCP, this SAP is a numerical value called a port. The combination of the port number, the host ID, and the protocol designation becomes a socket, which is logically equivalent to a file name (or handle) to the application running above TCP. Port numbers 0 through 1023 are called “well-known” port numbers because they are reserved for particular TCP applications.

661 11.4 Network Protocols II TCP/IP Architecture
TCP makes sure that the stream of data it provides to the application is complete, in its proper sequence and that no data is duplicated. TCP also makes sure that its segments aren’t sent so fast that they overwhelm intermediate nodes or the receiver. A TCP segment requires at least 20 bytes for its header. The data payload is optional. A segment can be at most 65,656 bytes long, including the header, so that the entire segment fits into an IP payload.

662 11.4 Network Protocols II TCP/IP Architecture
In 1994, the Internet Engineering Task Force began work on what is now IP Version 6. The IETF's primary motivation in designing a successor to IPv4 was, of course, to extend IP's address space beyond its current 32-bit limit to 128 bits for both the source and destination host addresses. This is a seemingly inexhaustible address space, giving 2128 possible host addresses. The IETF also devised the Aggregatable Global Unicast Address Format to manage this huge address space.

663 11.4 Network Protocols II TCP/IP Architecture
In 1994, the Internet Engineering Task Force began work on what is now IP Version 6. The IETF's primary motivation in designing a successor to IPv4 was, of course, to extend IP's address space beyond its current 32-bit limit to 128 bits for both the source and destination host addresses. This is a seemingly inexhaustible address space, giving 2128 possible host addresses. The IETF also devised the Aggregatable Global Unicast Address Format to manage this huge address space.

664 11.6 Network Organization Computer networks are often classified according to their geographic service areas. The smallest networks are local area networks (LANs). LANs are typically used in a single building, or a group of buildings that are near each other. Metropolitan area networks (MANs) are networks that cover a city and its environs. LANs are becoming faster and more easily integrated with WAN technology, it is conceivable that someday the concept of a MAN may disappear entirely. Wide area networks (WANs) can cover multiple cities, or span the entire world.

665 11.6 Network Organization In this section, we examine the physical network components common to LANs, MANs and WANs. We start at the lowest level of network organization, the physical medium level, Layer 1. There are two general types of communications media: Guided transmission media and unguided transmission media. Unguided media broadcast data over the airwaves using infrared, microwave, satellite, or broadcast radio carrier signals.

666 11.6 Network Organization Guided media are physical connectors such as copper wire or fiber optic cable that directly connect to each network node. The electrical phenomena that work against the accurate transmission of signals are called noise. Signal and noise strengths are both measured in decibels (dB). Cables are rated according to how well they convey signals at different frequencies in the presence of noise.

667 11.6 Network Organization The signal-to-noise rating, measured in decibels, quantifies the quality of the communications channel. The bandwidth of a medium is technically the range of frequencies that it can carry, measured in Hertz. In digital communications, bandwidth is the general term for the information-carrying capacity of a medium, measured in bits per second (bps). Another important measure is bit error rate (BER), which is the ratio of the number of bits received in error to the total number of bits received.

668 11.6 Network Organization Coaxial cable was once the medium of choice for data communications. It can carry signals up to trillions of cycles per second with low attenuation. Today, it is used mostly for broadcast and closed circuit television applications. _ Coaxial cable also carries signals for residential Internet services that piggyback on cable television lines.

669 11.6 Network Organization Twisted pair cabling, containing two twisted wire pairs, is found in most local area network installations today. It comes in two varieties: shielded and unshielded. Unshielded twisted pair is the most popular. _ The twists in the cable reduce inductance while the shielding protects the cable from outside interference..

670 11.6 Network Organization Electronic Industries Alliance (EIA), along with the Telecommunications Industry Association (TIA) established a rating system called EIA/TIA-568B. The EIA/TIA category ratings specify the maximum frequency that the cable can support without excessive attenuation. The ISO rating system refers to these wire grades as classes. Most local area networks installed today are equipped with Category 5 or better cabling. Some are installing fiber optic cable.

671 11.6 Network Organization Optical fiber network media can carry signals faster and farther than either or twisted pair or coaxial cable. Fiber optic cable is theoretically able to support frequencies in the terahertz range, but transmission speeds are more commonly in the range of about two gigahertz, carried over runs of 10 to 100 Km (without repeaters). Optical cable consists of bundles of thin (1.5 to 125 m) glass or plastic strands surrounded by a protective plastic sheath.

672 11.6 Network Organization Optical fiber supports three different transmission modes depending on the type of fiber used. Single-mode fiber provides the fastest data rates over the longest distances. It passes light at only one wavelength, typically, 850, 1300 or 1500 nanometers. Multimode fiber can carry several different light wavelengths simultaneously through a larger fiber core.

673 11.6 Network Organization Multimode graded index fiber also supports multiple wavelengths concurrently, but it does so in a more controlled manner than regular multimode fiber Unlike regular multimode fiber, light waves are confined to the area of the optical fiber that is suitable to propagating its particular wavelength. Thus, different wavelengths concurrently transmitted through the fiber do not interfere with each other.

674 11.6 Network Organization Fiber optic media offer many advantages over copper, the most obvious being its enormous signal-carrying capacity. It is also immune to EMI and RFI, making it ideal for deployment in industrial facilities. Fiber optic is small and lightweight, one fiber being capable of replacing hundreds of pairs of copper wires. But optical cable is fragile and costly to purchase and install. Because of this, fiber is most often used as network backbone cable, which bears the traffic of hundreds or thousands of users.

675 11.6 Network Organization Transmission media are connected to clients, hosts and other network devices through network interfaces. Because these interfaces are often implemented on removable circuit boards, they are commonly called network interface cards, or simply NICs. A NIC usually embodies the lowest three layers of the OSI protocol stack. NICs attach directly to a system’s main bus or dedicated I/O bus.

676 11.6 Network Organization Every network card has a unique 6-byte MAC (Media Access Control ) address burned into its circuits. The first three bytes are the manufacturer's identification number, which is designated by the IEEE. The last three bytes are a unique identifier assigned to the NIC by the manufacturer. Network protocol layers map this physical MAC address to at least one logical address. It is possible for one computer (logical address) to have two or more NICs, but each NIC will have a distinct MAC address.

677 11.6 Network Organization Signal attenuation is corrected by repeaters that amplify signals in physical cabling. Repeaters are part of the network medium (Layer 1). In theory, they are dumb devices functioning entirely without human intervention. However, some repeaters now offer higher-level services to assist with network management and troubleshooting.

678 11.6 Network Organization Hubs are also Physical layer devices, but they can have many ports for input and output. They receive incoming packets from one or more locations and broadcast the packets to one or more devices on the network. Hubs allow computers to be joined to form network segments.

679 11.6 Network Organization A switch is a Layer 2 device that creates a point-to-point connection between one of its input ports and one of its output ports. Switches contain buffered input ports, an equal number of output ports, a switching fabric and digital hardware that interprets address information encoded on network frames as they arrive in the input buffers. Because all switching functions are carried out in hardware, switches are the preferred devices for interconnecting high-performance network components.

680 11.6 Network Organization Bridges are Layer 2 devices that join two similar types of networks so they look like one network. Bridges can connect different media having different media access control protocols, but the protocol from the MAC layer through all higher layers in the OSI stack must be identical in both segments.

681 11.6 Network Organization A router is a device connected to at least two networks that determines the destination to which a packet should be forwarded. Routers are designed specifically to connect two networks together, typically a LAN to a WAN. Routers are by definition Layer 3 devices, they can bridge different network media types and connect different network protocols running at Layer 3 and below. Routers are sometimes referred to as “intermediate systems” or “gateways” in Internet standards literature.

682 11.6 Network Organization Routers are complex devices because they contain buffers, switching logic, memory, and processing power to calculate the best way to send a packet to its destination.

683 11.6 Network Organization Dynamic routers automatically set up routes and respond to the changes in the network. They explore their networks through information exchanges with other routers on the network. The information packets exchanged by the routers reveal their addresses and costs of getting from one point to another. Using this information, each router assembles a table of values in memory. Typically, each destination node is listed along with the neighboring, or next-hop, router to which it is connected.

684 11.6 Network Organization When creating their tables, dynamic routers consider one of two metrics. They can use either the distance to travel between two nodes, or they can use the condition of the network in terms of measured latency. The algorithms using the first metric are distance vector routing algorithms. Link state routing algorithms use the second metric. Distance vector routing is easy to implement, but it suffers from high traffic and the count-to-infinity problem where an infinite loop finds its way into the routing tables.

685 11.6 Network Organization In link state routing, router discovers the speed of the lines between itself and its neighboring routers by periodically sending out Hello packets. After the Hello replies are received, the router assembles the timings into a table of link state values. This table is then broadcast to all other routers, except its adjacent neighbors. Eventually, all routers within the routing domain end up with identical routing tables. All routers then use this information to calculate the optimal path to every destination in its routing table.

686 11.7 High Capacity Digital Links
Long distance telephone communication relies on digital lines. Because the human voice analog, it must be digitized before being sent over a digital carrier. The technique used for this conversion is called pulse-code modulation, or PCM. PCM relies on the fact that the highest frequency produced by a normal human voice is around 4000Hz. Therefore, if the voices of a telephone conversation are sampled 8,000 times per second, the amplitude and frequency can be accurately rendered in digital form.

687 11.7 High Capacity Digital Links
The figure below shows pulse amplitude modulation with evenly spaced (horizontal) quantization levels. Each quantization level can be encoded with a binary value. This configuration conveys as much information by each bit at the high end as the low end of the 4000Hz bandwidth.

688 11.7 High Capacity Digital Links
However, a higher fidelity rendering of the human voice is produced when the quantization levels of PCM are bunched around the middle of the band, as shown below. Thus, PCM carries information in a manner that reflects how it is produced and interpreted.

689 11.7 High Capacity Digital Links
Using127 quantization levels pulse-code modulation signal is distinguishable from a pure analog signal. So, the amplitude of the signal could be conveyed using only 7 bits for each sample. In the earliest PCM deployments, an eighth bit was added to the PCM sample for signaling and control purposes within the Bell System. Today, all 8 bits are used. A single stream of PCM signals produced by one voice connection requires a bandwidth of 64Kbps (8 bits  8,000 samples/sec.). Digital Signal 0 (DS-0) is the signal rate of the 64Kbps PCM bit stream.

690 11.7 High Capacity Digital Links
To form a transmission frame, a series of PCM signals from 24 different voice connections is placed on the line, with a control channel and framing bit forming a 125s frame. This process is called time division multiplexing (TDM) because each connection gets roughly 1/24th of the 125s frame. At 8,000 samples per second per connection, the combination of the voice channels, signaling channel and framing bit requires a total bandwidth of 1.544Mbps.

691 11.7 High Capacity Digital Links
Europe and Japan use a larger frame size than the one that is used in North America. The European standard uses 32 channels, two of which are used for signaling and synchronization and 30 which are used for voice signals. The total frame size is 256 bits and requires a bandwidth of 2.048Mbps. The 1.544Mbps and 2.048Mbps line speeds are called T-1 and E-1, respectively, and they carry DS-1 signals.

692 11.7 High Capacity Digital Links
DS-1 frames can be multiplexed onto high-speed trunk lines. The set of carrier speeds that results from these multiplexing levels is called the Plesiochronous Digital Hierarchy (PDH). As timing exchange signals propagate through the hierarchy, errors are introduced. The deeper the hierarchy, the more likely it is that the signals will drift or slip before reaching the bottom.

693 11.7 High Capacity Digital Links
During the 1980s, BellCore and ANSI formulated standards for a synchronous optical network, SONET. The Europeans adapted SONET to the E-carrier system, calling it the synchronous digital hierarchy, or SDH. Just as the basic signal of the T-carrier system is DS-1 at 1.544Mbps, the basic SONET signal is STS-1 (Synchronous Transport System 1) at 51.84Mbps.

694 11.7 High Capacity Digital Links
When an STS signal is passed over an optical carrier network, the signal is called OCx, where x is the carrier speed. The fundamental SDH signal is STM-1, which conveys signals at a rate of Mbps. The SONET hierarchy along with SDH is shown in the table.

695 11.7 High Capacity Digital Links
In 1982 the ITU-T completed a series of recommendations for the Integrated, Services Digital Network (ISDN), an all-digital network that would carry voice, video and data directly to the consumer. ISDN was designed in strict compliance with the ISO/OSI Reference Model. The ISDN recommendations focus on various network terminations and interfaces located at specific reference points in the ISDN model. The organization of this system is shown on the next slide.

696 11.7 High Capacity Digital Links

697 11.7 High Capacity Digital Links
ISDN supports two signaling rate structures, Basic and Primary. A Basic Rate Interface consists of two 64Kbps B-Channels and one 16Kbps D-Channel. These channels completely occupy two channels of a T-1 frame plus one-quarter of a third one. ISDN Primary Rate Interfaces occupy the entire T-1 frame, providing 23 64Kbps B-Channels and the entire 64Kbps D-Channel. B-Channels can be multiplexed to provide higher data rates, such as 128Kbps residential Internet service.

698 11.7 High Capacity Digital Links
Unfortunately, the ISDN committees were neither sufficiently farsighted nor fast enough in completing the recommendations. ISDN provides too much bandwidth for voice, and far too little for data. Except for a relatively small number of home Internet users, ISDN has become a technological orphan. The importance of ISDN is that it forms a bridge to a more advanced and versatile digital system, Asynchronous Transfer Mode (ATM).

699 11.7 High Capacity Digital Links
ATM does away with the idea of time-division multiplexing. Instead, conversation and each data transmission consists of a sequence of discrete 53-byte cells that can be managed and routed individually to make optimal use of whatever bandwidth is available. Moreover, ATM is designed to be an efficient bearer service for digital voice, data, and video streams. In years since, ATM has been adapted to also be a bearer service for LAN and MAN services.

700 11.7 High Capacity Digital Links
The CCITT called this next generation of digital services broadband ISDN, or B-ISDN, to emphasize its architectural connection with (narrowband) ISDN. ATM supports three transmission services: full-duplex Mbps, full-duplex Mbps and an asymmetrical mode with an upstream data rate of Mbps and a downstream data rate of Mbps. B-ISDN is downwardly compatible with ISDN. It uses virtually the same reference model, as shown on the next slide.

701 11.7 High Capacity Digital Links

702 11.8 A Look at the Internet We have described how the Internet went from its beginnings as a closed military research network to the open worldwide communications infrastructure of today. However, gaining access to the Internet is not quite as simple as gaining access to a dial tone. Most individuals and businesses connect to the Internet through privately operated Internet service providers (ISPs).

703 11.8 A Look at the Internet Each ISP maintains a switching center called a point-of-presence (POP). Some POPs are connected through high-speed lines (T-1 or higher) to regional POPs or other major intermediary POPs. Local ISPs are connected to regional ISPs, which are connected to national and international ISPs (often called National Backbone Providers, or NBPs). The NBPs are interconnected through network access points (NAPs). The ISP-POP-NAP hierarchy is shown on the next slide.

704 11.8 A Look at the Internet

705 11.8 A Look at the Internet Major Internet users, such as large corporations and government and academic institutions, are able to justify the cost of leasing direct high-capacity digital lines between their premises and their ISP. The cost of these leased lines is far beyond the reach of private individuals and small businesses. Consequently, Internet users with modest bandwidth requirements typically use standard telephone lines to serve their telecommunications needs.

706 11.8 A Look at the Internet Because standard telephone lines are built to carry analog (voice) signals, digital signals produced by a computer must first be converted, or modulated, from digital to analog form, before they are transmitted over the phone line. At the receiving end, they must be demodulated from analog to digital. A device called a modulator/ demodulator, or modem, converts the signal. Most home computers come equipped with built-in modems that connect directly to the system's I/O bus.

707 11.8 A Look at the Internet Modulating a digital signal onto an analog carrier means that some characteristic of the analog carrier signal is changed so that signal can convey digital information. Varying the amplitude, varying the frequency, or varying the phase of the signal can produce analog modulation of a digital signal. These forms of modulation are shown on the next slide.

708 11.8 A Look at the Internet

709 11.8 A Look at the Internet Using simple amplitude, frequency or 180 phase-change modulation, limits modem throughput to about 2400bps. Varying two characteristics at a time instead of just one increases the number of bits that can be transmitted. Quadrature amplitude modulation (QAM), changes both the phase and the amplitude of the carrier signal. QAM uses two carrier signals that are 180 out of phase with each other.

710 11.8 A Look at the Internet Two waves can be modulated to create a set of Cartesian coordinates. The X,Y coordinates in this plane describe a signal constellation or signal lattice that encodes specified bit patterns. A sine wave could be modulated for the Y-coordinate and the cosine wave for the X-coordinate.

711 11.8 A Look at the Internet Voice grade telephone lines are designed to carry a total bandwidth of 3000Hz. In 1924, information theorist Henry Nyquist showed that no signal can convey information at a rate faster than twice its frequency. Symbolically: where baud is the signaling speed of the line. A 3000Hz signal can transmit two-level (binary) data at a rate no faster than 6,000 baud.

712 11.8 A Look at the Internet In 1948, Claude Shannon extended Nyquist's work to consider the presence of noise on the line, using the line's signal-to-noise ratio. Symbolically: The public switched telephone network (PSTN) typically has a signal-to-noise ratio of 30dB. It follows that the maximum data rate of voice grade telephone lines is approximately 30,000bps, regardless of the number of signal levels used.

713 11.8 A Look at the Internet The 30Kbps limit that Shannon's Law imposes on analog telephone modems is a formidable barrier to the promise of a boundless and open Internet. While long-distance telephone links have been fast and digital for decades, the local loop wires running from the telephone switching center to the consumer continues to use hundred-year-old analog technology. The "last mile" local loop, can in fact span many miles, making it extremely expensive to bring the analog telephone service of yesterday into the digital world of the present.

714 11.8 A Look at the Internet The physical conductors in telephone wire are thick enough to support moderate-speed digital traffic for several miles without severe attenuation. Digital Subscriber Line (DSL) is a technology that can coexist with plain old telephone service (POTS) on the same wire pair that carries the digital traffic. At present, most DSL services are available only to those customers whose premises connect with the central telephone switching office (CO) using less than 18,000 feet (5,460 m) of copper cable.

715 11.8 A Look at the Internet At the customer's premises, some DSLs require a splitter to separate voice from digital traffic. The digital signals terminate at a coder/decoder device often called a DSL modem. There are two different—and incompatible— modulation methods used by DSL: Carrierless Amplitude Phase (CAP) and Discrete MultiTone Service (DMT). CAP is the older and simpler of the two technologies, but DMT is the ANSI standard for DSL.

716 11.8 A Look at the Internet CAP uses three frequency ranges, 0 to 4KHz for voice, 25KHz through 160KHz for "upstream" traffic (e.g., sending a command through a browser asking to see a particular Web page), and 240KHz to 1.5MHz for "downstream" traffic This imbalanced access method is called Asymmetric Digital Subscriber Line (ADSL). The fixed channel sizes of CAP lock in an upstream bandwidth of 135KHz. This may not be ideal for someone who does a great deal of uploading, or connects to a remote LAN.

717 11.8 A Look at the Internet Where a symmetric connection is required, Discrete MultiTone DSL may offer better performance. DMT splits a 1MHz frequency bandwidth into 256 4KHz channels, called tones. These channels can be configured in any way that suits both the customer and the provider. DMT can adapt to fluctuations in line quality. When DMT equipment detects excessive crosstalk or excessive attenuation on one of its channels, it stops using that channel until the situation is remedied.

718 11.8 A Look at the Internet The analog local loop one of the problems facing the Internet today. A more serious problem concerns backbone router congestion. More than 50,000 routers serve various backbone networks in the United States alone. Considerable time and bandwidth is consumed as the routers exchange routing information. Obsolete routes can persist long enough to impede traffic, causing even more congestion as the system tries to resolve the error.

719 11.8 A Look at the Internet Greater problems develop when a router malfunctions, broadcasting erroneous routes (or good routes that it subsequently cancels) to the entire backbone system. This is known as the router instability problem and it is an area of continuing research. When IPv6 is adopted universally some of these problems will go away because the routing tables ought to get smaller.

720 11.8 A Look at the Internet Even with improved addressing, there are limits to the speed with which tens of thousands of routing tables can be synchronized. This problem is undergoing intense research, the outcome of which may give rise to a new generation of routing protocols. One thing is certain, simply giving the Internet more bandwidth offers little promise for making it any faster in the long-term. It has to get smarter.

721 Chapter 11 Conclusion The ISO/OSI RM describes a theoretical network architecture. This architecture has to some extent been incorporated into digital telecommunication systems, including ISDN and ATM. TCP/IP using IPv4 is the protocol supported by the Internet. IPv6 has been defined and implemented by numerous vendors, but its adoption is incomplete.

722 Chapter 11 Conclusion Network organization consists of physical (or wireless) media, NICs, modems, CSU/DSUs, repeaters, hubs, switches, routers, and computers. Each has its place in the OSI RM. Many people connect to the Internet through dial up lines using modems. Faster speeds are provided by DSL. The Internet is a hierarchy of ISPs, POPs, NAPs, and various backbone systems. The router instability problem is one of the largest challenges for the Internet.

723 Chapter 11 Homework Due: 12/1/2010 Pages: 570-573
Exercises: 3,4,7,12,14,17,18,20,21,22,24,26.


Download ppt "Chapter 1 Introduction."

Similar presentations


Ads by Google