100 likes | 234 Views
Lecture 7. Monday 20 th Oct 2008 Today's Agenda Hardware Concepts Main Memory Recall from last lecture What's latest in microprocessor technology? Multiprocessors (e-g intel duo) Hyper threaded technology Examples of system software?. Hard Disk. Input device. CPU. Output Device.
E N D
Lecture 7 • Monday 20th Oct 2008 • Today's Agenda • Hardware Concepts • Main Memory • Recall from last lecture • What's latest in microprocessor technology? • Multiprocessors (e-g intel duo) • Hyper threaded technology • Examples of system software?
Hard Disk Input device CPU Output Device Main Memory Computer Hardware
For the purpose of storing data, a computer contains a large collection of circuits, each capable of storing a bit. This bit reservoir is known as the machines main memory. The storage circuits in a machines main memory are arranged in manageable units called cells or (words), with typical cell size being 8 bits. Bit collections of size eight are known as Byte. The size of a machines main memory is measured in terms of 1048,576 cell units.( The value 1048,576 is a power of 2 namely 220 , so it is more natural as a unit of measure than an even 1000,000. The termMega is used to indicate this measure. 10110101 10011111 Cell 1 Cell 2 Cell n Main Memory
The abbreviation MB is often used for the term Megabyte. Thus a memory of 4MB contains 4194,394 (4*1,048,576) cells, each of which is one byte in size. • Other units of measuring are Kilobyte (KB) which is equal to 1024 bytes ( 210 bytes) and Gigabyte (GB) which is equal to 1024 MB or ( 230 bytes). • To identify individual cells in the machines memory, each cell is assigned a unique name called its address. • Memory cells addresses are entirely numeric. • To be more precise, we can envision all the cells being placed in a single row and numbered in this order starting with the value zero. • The cells in a 4MB memory would be therefore addressed as 0, 1, 2……, 4194304 • Remember 4MB contains 4*1,048576=4194304 memory cells • Note that such an addressing system not only gives us a way of uniquely identifying each cell but also associates an order to the cell, (refer to figure in the last slide) giving us phrases such as “the next cell” or “the previous cell”. • To complete the main memory of the machine, the circuitry that actually holds the bits is combined with the circuitry required to allow other circuits to store and retrieve data from the memory cells. • In this way other circuits can get data from the memory by electronically asking for the contents of a certain address (called read operation) or they could record information in the memory by requesting that a certain bit pattern be placed in the cell at a particular address (called the write operation). • An important consequence of machines main memory as small addressable cells is that each cell can be accessed individually. That is, data stored in a machines main memory can be processed in random order which explains why main memory is often referred to as random access memory (RAM).
Most significant bit Least significant bit 01101101 High order end Low order end • This random accessibility of small data units is in stark contrast to the mass storage systems (that will be discussed later) in which long strings of bits must be manipulated as a block. • We envision the bits within a memory cells as being arranged in a row. We call one end as the high-order end and the other the low-order end. • Although there is no left or right in a machine, we imagine the bits arranged in a row from left to right with high-order end arranged on the left. The bit at this end is called the most significant bit; similarly the bit at the lower end is called the least significant bit. • We may represent the contents of a byte-size cell as shown below
An important consequence of ordering of both the cells in the main memory and the bits within each cell is that the entire collection of bits within a machines main memory is essentially ordered in one long row. • Pieces of this long row can therefore be used to store bit patterns that may be longer than the length of a single cell. • In particular if the memory is divided into byte size cells, we can still store a string of 16 bits merely by using 2 consecutive memory cells. • Class exercise (12 min- collaboration allowed) • How many bits would be in the memory of a computer with 4KB memory? • If the memory cell whose address is 5 contains the value 8, what is the difference between writing a value 5 into cell number 6 and moving the contents of cell number 5 into cell number 6? • Suppose you want to interchange the values stored in memory cells 2 and 3. What is wrong with the following steps of sequence of steps: Step1: Move the contents of cell number 2 to cell number 3 Step2: Move the contents of cell number 3 to cell number 2 Design a sequence of steps that correctly interchange the contents of these cells.
Size of Main Memory (revisited) (RRM slide 7 to 10) • For the sake of discussion assume main memory to be 1MB. • MAIN MEMORY= 1MB 1MB =2²° bytes. =1048,576 bytes OR 1048,576B. Where B=Bytes Aside (another way of looking at it) : 1KB =1024B 1MB =1024KB =1024*1024 = 1048,576B • Conceptually its is best to imagine the main memory as consisting of a very long list of individual bytes (each byte having its own address) – e-g a 32 MB PC has =32*1048576 =33,554,432 or ( 225 ) bytes numbered from 0 to 33554,431 as in computers counting starts from 0.
Question : In 64MB of memory, calculate the actual bytes of memory and also indicate the last address? 1MB = 1048,576B 64 MB = 64 * 1048576 = 67108864 bytes of memory • Last location will be binary equivalent of 67108863 • Aside (another way of looking at it): 64MB =64*1MB =64*1024KB =64*1024*1024B =26* 210 * 210 B =226 B =67108864 Bytes
Main Memory Bus ALU CPU Registers Main Memory (from the hardware perspective) • The main memory is the storage space for data that is directly accessed by the CPU. • Its typically consists of a set of single in-line memory modules (SIMMs) mounted on the computers motherboard close to the CPU. • SIMMs could be of various sizes (e-g 1MB, 128 MB and so on) • The circuitry that performs operations such as additions and subtraction etc on data is not directly connected to the storage cells in the machines main memory. • Instead this circuitry is isolated in a part of computer called the Central Processing Unit or CPU. This unit consists of 2 parts: the arithmetic/logic unit (ALU) which contains circuitry that performs data manipulation and the control unit which contains circuitry for coordinating machines activities.
CPU • Resides on a single chip called the microprocessor e-g Intel Pentium 2 is a popular example • More on CPU later… • Speed of Computer • Microprocessors are usually rated in terms of their internal clock. A computers speed is usually measured in MHz. A 300Mhz processor has a cock that ticks 300,000,000 times per second • This means that the computer can execute 300,000,000 instructions in 1 second which in turn means that each instruction takes (3.3 nano sec or 1/300,000,000 sec • to execute). • (1 nano sec is 1 billionth of a sec i-e 10-9 sec). • In practice that speed is rarely attained because the processor has to wait for other components to catch up.