CPEN 4700 Exam Two Review Questions And Correct Answers
CPU's Three Major Components
An Arithmetic/Logic Unit (ALU) that operates on binary data.
Registers to store operands and/or memory addresses of operands
A control unit to control and sequence actions of the other components (and rest of
system) based on program instructions
Von Neumann execution cycle
How a machine implements the steps. Includes: Fetch, decode, execute, write back
instruction (FDEW)
Brainpower
Read More
Instruction Set Architecture (ISA)
That part of the computer architecture that is visible to the programmer, including the
native data types, instructions, registers, addressing modes, memory architecture,
interrupt and exception handling, and external I/O.
Computer systems with the same ISA are compatible - they can all run the same
programs
bit fields
In a machine language instruction format of some number of bits the bits are divided
into this. Each part has meaning to the control unit.
EX IMAGE below (16 bits divided into a total of five bit fields)
Operation Code (Op code)
The leftmost field (4 bits). It determines the function of the instruction--What will it do?
Operation Code Details
The number of op code bits determines the number of different machine language
instructions the computer can have. In this case, four bits are used for the op code- thus
machine can have at most 2^4 = 16 different instructions Need more bits for op code for
more machine instructions
,Register Selection Field
The Second and Fourth fields- they each determine which CPU registers will be used by
the instructions.
the number of bits determines the number of registers that the machine can have.
In this case, three bits are used to identify each register--therefore the machine can only
have 2^3 = 8 registers (at least of the type used by this instruction)
Mode Selection Field
The Third and fifth fields-they determine which addressing modes will be used by the
instruction to locate operands (In conjunction with the associated registers)
The number of bits determines the numbers of the addressing mode to be used in
identifying the operand for the machine instructions. In this case, three bits are used to
identify the mode - therefore the machine can only have up to 2^3 =8 addressing modes
for operands.
Instruction types --might be asked to give an example (can describe an action, doesn't
necessarily have to be a real instruction mnemonic), or match an example with an
instruction type
Data transfer, Computational, Control Transfer, I/O, System control, Miscellaneous
Registers
are used to holdoperands and/or memory addressesfor operands
Data Transfer Instruction Type
Copy data from one place to another within the machine (without doing any actual
computation)
,Memory to register. Register to memory. Register to register. Memory to memory (in
some machines). Constant to register or memory
Computational Instructions type
Computational instructions produce a numeric outcome(s) based on the operands and
the operation being performed upon them.
1. Integer arithmetic (ex. addition, multiplication)
2. Real-number arithmetic (if necessary for the applications the processor will be used
in) (ex. also addition, multiplication)
3. Boolean logic (ex. AND, OR)
4. Bit shifting (shifting bits left or right)
5. Comparisons MQTT) ex. <, >, =
Input transfer instructions type
Those which may affect the normal sequential execution of instructions, i.e., change the
program counter or instruction pointer.
Input/Output instructions type
Those that allow the CPU to output or input data to/from peripheral devices that link the
computer to the outside world (users or other computers)
System instructions Type
Usually that ones which allow the OS to control the system environment - things we'd
typically not want user/application programs to be capable of doing:
• Enable/disable interrupts
• Switching privilege levels
• Cache/MMU control
• etc.
Miscellaneous
, Type
nstructions which do not clearly fit into any of the above categories ca
*Given an instruction in assembly/binary and some information about it, show the
opposite and describe the operands and what it does
Find Example in 3.1 Slideshow
The operation to be performed is chosen by.
the operation code
Addressing Modes Definition
The way(s) that the architecture has of specifying the value(s) and/or location(s) of
instruction operands.
Immediate Addressing -- OPERAND is in Instruction
Include the operand itself (in binary form) in the machine language instruction. That is
the instruction explicitly states what the operand is.
Major advantage of immediate addressing is speed of execution.
CPU's Three Major Components
An Arithmetic/Logic Unit (ALU) that operates on binary data.
Registers to store operands and/or memory addresses of operands
A control unit to control and sequence actions of the other components (and rest of
system) based on program instructions
Von Neumann execution cycle
How a machine implements the steps. Includes: Fetch, decode, execute, write back
instruction (FDEW)
Brainpower
Read More
Instruction Set Architecture (ISA)
That part of the computer architecture that is visible to the programmer, including the
native data types, instructions, registers, addressing modes, memory architecture,
interrupt and exception handling, and external I/O.
Computer systems with the same ISA are compatible - they can all run the same
programs
bit fields
In a machine language instruction format of some number of bits the bits are divided
into this. Each part has meaning to the control unit.
EX IMAGE below (16 bits divided into a total of five bit fields)
Operation Code (Op code)
The leftmost field (4 bits). It determines the function of the instruction--What will it do?
Operation Code Details
The number of op code bits determines the number of different machine language
instructions the computer can have. In this case, four bits are used for the op code- thus
machine can have at most 2^4 = 16 different instructions Need more bits for op code for
more machine instructions
,Register Selection Field
The Second and Fourth fields- they each determine which CPU registers will be used by
the instructions.
the number of bits determines the number of registers that the machine can have.
In this case, three bits are used to identify each register--therefore the machine can only
have 2^3 = 8 registers (at least of the type used by this instruction)
Mode Selection Field
The Third and fifth fields-they determine which addressing modes will be used by the
instruction to locate operands (In conjunction with the associated registers)
The number of bits determines the numbers of the addressing mode to be used in
identifying the operand for the machine instructions. In this case, three bits are used to
identify the mode - therefore the machine can only have up to 2^3 =8 addressing modes
for operands.
Instruction types --might be asked to give an example (can describe an action, doesn't
necessarily have to be a real instruction mnemonic), or match an example with an
instruction type
Data transfer, Computational, Control Transfer, I/O, System control, Miscellaneous
Registers
are used to holdoperands and/or memory addressesfor operands
Data Transfer Instruction Type
Copy data from one place to another within the machine (without doing any actual
computation)
,Memory to register. Register to memory. Register to register. Memory to memory (in
some machines). Constant to register or memory
Computational Instructions type
Computational instructions produce a numeric outcome(s) based on the operands and
the operation being performed upon them.
1. Integer arithmetic (ex. addition, multiplication)
2. Real-number arithmetic (if necessary for the applications the processor will be used
in) (ex. also addition, multiplication)
3. Boolean logic (ex. AND, OR)
4. Bit shifting (shifting bits left or right)
5. Comparisons MQTT) ex. <, >, =
Input transfer instructions type
Those which may affect the normal sequential execution of instructions, i.e., change the
program counter or instruction pointer.
Input/Output instructions type
Those that allow the CPU to output or input data to/from peripheral devices that link the
computer to the outside world (users or other computers)
System instructions Type
Usually that ones which allow the OS to control the system environment - things we'd
typically not want user/application programs to be capable of doing:
• Enable/disable interrupts
• Switching privilege levels
• Cache/MMU control
• etc.
Miscellaneous
, Type
nstructions which do not clearly fit into any of the above categories ca
*Given an instruction in assembly/binary and some information about it, show the
opposite and describe the operands and what it does
Find Example in 3.1 Slideshow
The operation to be performed is chosen by.
the operation code
Addressing Modes Definition
The way(s) that the architecture has of specifying the value(s) and/or location(s) of
instruction operands.
Immediate Addressing -- OPERAND is in Instruction
Include the operand itself (in binary form) in the machine language instruction. That is
the instruction explicitly states what the operand is.
Major advantage of immediate addressing is speed of execution.