GCSE Computing#BristolMet Session Objectives#11 MUST identify what program instructions consist of SHOULD describe how instructions are coded as bit patterns COULD explain how the computer distinguishes between data and memory addresses Write a simple program using machine code
6
Embed
GCSE Computing#BristolMet Session Objectives#11 MUST identify what program instructions consist of SHOULD describe how instructions are coded as bit patterns.
This document is posted to help you gain knowledge. Please leave a comment to let me know what you think about it! Share it to your friends and learn new things together.
Transcript
GCSE Computing#BristolMet
Session Objectives#11
MUST identify what program instructions consist of
SHOULD describe how instructions are coded as bit patterns
COULD explain how the computer distinguishes between data and memory addresses
Write a simple program using machine code
GCSE Computing#BristolMet
Representation of Program Instructions
During the fetch phase of the processing cycle, the CPU fetches the first instruction from the start memory address location. The CPU will then decode the instruction to find out what it needs to do next. In the meantime it has already updated a register, the program counter, to point to the next memory location so that it can fetch the next instruction.
A program instruction, for example “print” [character A] has 2 parts, the instruction “print” which is called the operator, and the data part, the operand, in this case [A].
The operand may be specific data or it may be a reference to another memory address location, to save to or retrieve previously stored data from. A typical instruction may be to add the data in a memory location to data in another register, the accumulator
GCSE Computing#BristolMet
KEY TERMS
Register – Special fast access part of the CPU that stores data in use by the CPU.Program Counter – A register in the CPU that keeps the address of the next instruction.Accumulator – A register in the CPU that stores data currently being used by the CPU.Operator – The part of the instruction which tells the computer what to do.Operand – The part of the instruction that tells the CPU what to apply the operation to (either specific data or a memory address).
What does the Program counter do when it receives a new instruction?
Can you think of examples of operations which occur in the accumulator
GCSE Computing#BristolMet
Representation of Program Instructions
The diagram below is of a 10 bit instruction.The first three bits represent the op-code and the final six bits represent the operand. The middle bit (the number bit) distinguishes between operands that are memory addresses and operands that are numbers. When the bit is set to '1', the operand represents a number. 0 would mean???
GCSE Computing#BristolMet
Machine Code and Assembly Language
Notice that all the op-codes are given an English mnemonic to simplify programming. Together these mnemonics are called an assembly language. Programs written in assembly language must be converted to their binary representation before the CPU can understand them. This is usually done by another program called an assembler, hence the name.View the program simulations