Vous êtes sur la page 1sur 14

Click to edit Master subtitle style

Machine Cycle and Memory

4/21/12

HOW THE CPU EXECUTES PROGRAM INSTRUCTIONS (1)


* Step 1: Fetching The control unit fetches (gets) the instruction from memory. * Step 2: Decoding The control unit decodes the instruction (decides what it means) and directs that the necessary data be moved from memory to the arithmetic/logic unit. * Step 3: Executing The ALU executes the arithmetic or logic instruction. That is, the ALU is given control and performs the actual operation on the data. * Step 4: Storing The result of this operation in stored in memory or register.

4/21/12

HOW THE CPU EXECUTES PROGRAM INSTRUCTIONS (2)


* Fetching means obtaining the next program instruction from main memory. * Decoding is translating the program instruction into the commands the computer can understand * Executing refers to the actual processing of the computer commands. * Storing takes place when the result of the instruction is written to main memory or register.

4/21/12

HOW THE CPU EXECUTES PROGRAM INSTRUCTIONS (3)


* I-time These first two steps, fetching and decoding, are called instruction time, or I-time. * E-time Step 3 and 4, Executing and storing, are called execution time, or E-time. * Machine Cycle Combination of I-time and E-time is called the machine cycle.

4/21/12

MACHINE LANGUAGE INSTRUCTIONS (1)


* Machine Language Instruction Machine language instruction is binary data that the electronic circuits in the CPU can interpret and convert into one or more of the commands in the computers instruction set. * Instruction Set Instruction set contains commands, such as ADD or MOVE, that the computers circuits can directly perform.

4/21/12

MACHINE LANGUAGE INSTRUCTIONS (2)


* Machine Language Instruction Operation Code (Opcode) + Operand(s) * Operation Code- An operation code tells the computer what to do and matches one of the commands in the instruction set. * Operand- An operand specifies the data or the location of the data that will be used by the instruction. * Example opcode 00000101 ADD operand1 32 operand2 00000000 to a register in CPU 00100000

4/21/12

MEMORY (1)
* Definitions of Memory Memory refers to integrated circuits that store program instructions and data that can be retrieved. Memory is the part of the computer that holds data and instructions for processing. * Names of Memory primary storage main storage main memory primary memory internal storage

4/21/12

RAM AND ROM - MEMORY (2)


* Random Access Memory (RAM) - Memory that provides temporary storage for data and program instructions. - The programs and data stored in RAM are erased when the power to the computer is turned off. * Read Only Memory (ROM) - Memory that can be read-only and that store data or instructions that do not change. - Data and instructions in it remains after the power is turned off.

4/21/12

TYPES OF RAM - MEMORY (3)


* Static Random Access Memory (SRAM) A type of RAM that requires a continuous current to hold data. SRAM is usually faster, but larger and more expensive than dynamic RAM. * Dynamic Random Access Memory (DRAM) A type of RAM that stores its memory in a charge that must be constantly refreshed. It is the most common memory in personal computers because of its size and cost.

4/21/12

TYPES OF RAM - MEMORY (4)


* Flash Memory Type of RAM that can retain data even when power is turned off. Flash memory is sometimes used instead of a disk drive in small portable computers. * Cache Memory High - speed RAM between the CPU and the main memory that increases processing efficiency. Cache memory is used to store the most frequently used instructions and data.

4/21/12

TYPES OF RAM - MEMORY (5)


* Conventional Memory Memory located in the first 640K of RAM that is used for the operation system, programs, and data. * Upper Memory Memory located between 640K and 1MB of RAM that is used for programs that control input and output devices and other computer hardware * Extended Memory All memory above 1MB, used for programs and data.

4/21/12

MEMORY ADDRESS- MEMORY (6)

* Basic Unit of Memory The basic unit of memory is a byte, which consists of eight bits. * Memory Address The number that indicates the location of a byte in memory is called a memory address.

4/21/12

MEASUREMENT OF MEMORY SIZE


The size of memory is measured in kilobyte, megabyte, or gigabyte. * Kilobyte A kilobyte (K or KB) is equal to 1,024 bytes, but for discussion purposes, is usually rounded to 1,000 bytes. * Megabyte A megabyte (MB) is equal to 1,048,576 bytes, or is approximately one million bytes. * Gigabyte A gigabyte (GB) is equal to 1,073,741,824 bytes, or is approximately one billion bytes.

4/21/12

READ ONLY MEMORY (ROM)


Memory that can be read-only and that store data or instructions that do not change. * ROM Burner A specialized device used to program read-only memory chips. * Programmable Read - Only Memory (PROM) Chips that can be programmed with specialized tools called ROM burners. * Firmware Instructions that are stored in ROM are called firmware or microcode.

4/21/12