Docsity

Main Memory Organization - Lecture Notes | ECS 050, Study notes of Computer Science

Toggle sidebar
bg1
ECS 50 Chapter 2 Lecture Notes
I. Main Memory Organization and Major Hardware Components
A. What is the type of information stored in a memory location?
1. Unknown by hardware.
2. It is in the hands of the programmer/compiler.
a) int y = -32697; /* 0x8047 */
b) printf("%d %u %c\n", y, y, y); /* in a 32 bit machine: */
c) -32697 32839 G in a 32 bit
II. Main Memory Organization
A. word size = usually the size of number used in CPU addition circuitry. 32 bits usually now. Integers
the size of a word.
B. How are multiple byte words stored?
1. Little-endian. LSByte has lower address. Intel.
2. Big-endian. LSByte has highest address. VAX, SPARC, CUSP.
a) Allows word subtraction for alphabetizing.
3. MIPS and PowerPC give the OS the choice of either endian when it boots.
C. Words must be aligned in most machines. In 32-bit, means words only begin at addresses which are
multiples of 4. Thus byte access and word access are two different things.
D. Most RISC machines tend to use fixed instruction length equal to the word size.
E. Most CISC machines have variable instruction lengths, 1 - 6 bytes or more.
F. address size = number of bits in an address. CUSP 12 bits, 8086 20 bits, 286 24 bits, 386+ and RISC
32 bit.
III. Four Major Hardware Components of a Computer
A. CPU
1. ALU = arithmetic and logic unit. Arithmetic, bitwise operations, compare. Doesn't store
anything.
2. Control Unit is intelligence of CPU. Does decoding.
3. Registers
pf2

Partial preview of the text

Download Main Memory Organization - Lecture Notes | ECS 050 and more Study notes Computer Science in PDF only on Docsity!

ECS 50 Chapter 2 Lecture Notes I. Main Memory Organization and Major Hardware Components A. What is the type of information stored in a memory location?

  1. Unknown by hardware.
  2. It is in the hands of the programmer/compiler. a) int y = -32697; /* 0x8047 / b) printf("%d %u %c\n", y, y, y); / in a 32 bit machine: */ c) -32697 32839 G in a 32 bit II. Main Memory Organization A. word size = usually the size of number used in CPU addition circuitry. 32 bits usually now. Integers the size of a word. B. How are multiple byte words stored?
  3. Little-endian. LSByte has lower address. Intel.
  4. Big-endian. LSByte has highest address. VAX, SPARC, CUSP. a) Allows word subtraction for alphabetizing.
  5. MIPS and PowerPC give the OS the choice of either endian when it boots. C. Words must be aligned in most machines. In 32-bit, means words only begin at addresses which are multiples of 4. Thus byte access and word access are two different things. D. Most RISC machines tend to use fixed instruction length equal to the word size. E. Most CISC machines have variable instruction lengths, 1 - 6 bytes or more. F. address size = number of bits in an address. CUSP 12 bits, 8086 20 bits, 286 24 bits, 386+ and RISC 32 bit. III. Four Major Hardware Components of a Computer A. CPU
  6. ALU = arithmetic and logic unit. Arithmetic, bitwise operations, compare. Doesn't store anything.
  7. Control Unit is intelligence of CPU. Does decoding.
  8. Registers

a) PC = Program counter. Contains address of currently executing instruction. b) On Intel actually CS (code segment) and IP (instruction pointer). (1) 16-bit mode has 20 bit addresses, uses 16 bit CS as MSB and then adds 16 bit IP. (2) 32-bit mode has 32 bit addresses uses 32 bit CS and IP. c) SP = Stack pointer. Contains address of top of stack for temporary storage. d) XR = Index register. Helps access arrays. e) PS = Process status register. Contains flags, including condition codes and big-endian vs little endian flag for PowerPC and MIPS. f) DRs = Data registers. (1) Word size (2) CUSP: Accumulator (3) MIPS has 32 32-bit general purpose registers + PC and two for multiplication (4) SPARC has 8 global and a register window onto a "register file"that sees 24 registers at a time. Implementations allow 2 to 32 windows. Great for procedure calls. Think of as top of stack. g) MAR = Memory address register. CPU connection to address bus. h) MDR = Memory data register. CPU connection to data bus. i) IR = Instruction register. Holds current instruction, so MDR may be overwritten.

  1. Memory a) Internal cache on CPU Chip. b) Pentium 8K data, 8K address c) Secondary Cache on motherboard before system bus. 256K - 1M; 15 ns B. Main memory on motherboard 60 ns
  2. Secondary Memory on disk 10000 ns C. I/O Devices
  3. Keyboards, monitors, CD-ROMs, modems, printers, modems, floppy disks, hard disks D. System Bus
  4. Data Bus-Same number of lines as bits in a memory word. a) CUSP 24 bits b) Petium 2 * 32-bits allows two words to be accessed simultaneously.
  5. Address Bus-Same number of lines as bits in the computer's addresses a) CUSP 12 bits
  6. Control Bus a) MEMR and MEMW tell memory whether to read or write. IV. Instruction Cycle-Fetch, decode, execute. A. Fetch by transferring instruction at address of PC from memory to IR B. Decode instruction using microcode of CPU.
  7. Also increment PC C. Execute the instruction. V. Self-Modifying Programs A. The only thing to be learned from these is that code and data are indistinguishable to the computer.