18
Computer Architecture Memory, Math and Logic

Computer Architecture Memory, Math and Logic. Basic Building Blocks Seen: – Memory – Logic & Math

Embed Size (px)

Citation preview

Page 1: Computer Architecture Memory, Math and Logic. Basic Building Blocks Seen: – Memory – Logic & Math

Computer ArchitectureMemory, Math and Logic

Page 2: Computer Architecture Memory, Math and Logic. Basic Building Blocks Seen: – Memory – Logic & Math

Basic Building Blocks

• Seen:– Memory

– Logic & Math

Page 3: Computer Architecture Memory, Math and Logic. Basic Building Blocks Seen: – Memory – Logic & Math

Higher Level Architecture

• CPU– Central Processing Unit

• Memory– Programs and Data

• Input & Output– Keyboards, Mice, Screens

Printers, Networks, etc…

CPU

Memory

Input & Output

Page 4: Computer Architecture Memory, Math and Logic. Basic Building Blocks Seen: – Memory – Logic & Math

Busses

• Busses– Groups of wires that carry a signal

• 1 wire for each bit

• Separate busses fordifferent signals

Page 5: Computer Architecture Memory, Math and Logic. Basic Building Blocks Seen: – Memory – Logic & Math

Memory

• Memory– Collection of bytes– Access byte by address

Page 6: Computer Architecture Memory, Math and Logic. Basic Building Blocks Seen: – Memory – Logic & Math

Memory

• Memory– Collection of bytes– Access byte by address– Meaning defined by program

• Byte 0x00 could be:

– 74– J– Red part of a 24-bit color

0x00-0x02– Part of a 64-bit floating point

0x00-0x07

Page 7: Computer Architecture Memory, Math and Logic. Basic Building Blocks Seen: – Memory – Logic & Math

Memory Hierarchy

• Memory is– Too slow– Too small– Temporary

Page 8: Computer Architecture Memory, Math and Logic. Basic Building Blocks Seen: – Memory – Logic & Math

Memory Hierarchy

• Main Memory : medium speed/capacity– RAM

Page 9: Computer Architecture Memory, Math and Logic. Basic Building Blocks Seen: – Memory – Logic & Math

Memory Hierarchy

• On processor: Small, Ultra Fast memory– Registers– Cache

Page 10: Computer Architecture Memory, Math and Logic. Basic Building Blocks Seen: – Memory – Logic & Math

Memory Hierarchy

• Secondary Memory : slower, larger, permanent storage– Hard drives– Flash drives

Page 11: Computer Architecture Memory, Math and Logic. Basic Building Blocks Seen: – Memory – Logic & Math

Inside the CPU

• Registers– Small high speed memory

• ALU– Arithmetic Logic Unit

• CU– Control Unit

Memory

Input & Output

Page 12: Computer Architecture Memory, Math and Logic. Basic Building Blocks Seen: – Memory – Logic & Math

Registers

• Registers – Special purpose memory in CPU

• Examples:– PC : Program Counter

What memory address has next instruction

– IR : Instruction RegisterWhat instruction we are working on

– ACC : AccumulatorResult of what we just did

Page 13: Computer Architecture Memory, Math and Logic. Basic Building Blocks Seen: – Memory – Logic & Math

ALU

• Arithmetic Logic Unit• Can:– Add/Subtract• Multiply/divide handled

by special purpose hardware

– Logic Tests• < > =

– Bit Operations• Not, OR, AND, shifts,…

Page 14: Computer Architecture Memory, Math and Logic. Basic Building Blocks Seen: – Memory – Logic & Math

ALU cont…

• Common representation:– 2 main inputs • Additional input to pick operation

– 1 main output

Page 15: Computer Architecture Memory, Math and Logic. Basic Building Blocks Seen: – Memory – Logic & Math

CU

• Control Unit– Decoder : reads instructions

from IR, sends control signalsto control ALU, memory

– Clock : synchronizes operations across computer

Page 16: Computer Architecture Memory, Math and Logic. Basic Building Blocks Seen: – Memory – Logic & Math

Machine Code

• Machine Code : Instruction stored as binary– Bits to represent• operation to perform (opcode)• value to use (operand)

0001 1100 0100 1011

Page 17: Computer Architecture Memory, Math and Logic. Basic Building Blocks Seen: – Memory – Logic & Math

Sample Code

Machine code Function

0010000010 Load the value 2 into the Accumulator

0010000101 Load the value 5 into the Accumulator

0100001101 Store the value of the Accumulator in memory location 13

0110001101 Add the value of memory location 13 to the Accumulator

Page 18: Computer Architecture Memory, Math and Logic. Basic Building Blocks Seen: – Memory – Logic & Math

Fetch-Decode-Execute

• Fetch – Decode – Execute

http://computerscience.chemeketa.edu/cs160Reader/ComputerArchitecture/MachineCycle.html