In: Computer Science
Show ALL work if it is required for the question and BASES
7. Name 3 components of the CPU and the Buses. Describe what they do.
8. Name 4 essential status flags and describe what they do.
9. Translate this Expression to Assembly: EAX = -val2 + 7 - val3 + val1
7. Three components of CPU are:
1) Arithmetic Logic Unit (ALU)
The ALU is the part of a CPU that performs all arithmetic computations including addition, subtraction, multiplication, and division. The Arithmetic Logic Unit also performs all logical operations. The ALU is a literally the fundamental building block of the CPU, and even the simplest processors contain an ALU.
2)Control Unit
The CPUs control unit is responsible for executing or storing the results coming out of the ALU. Within the CPU, the control unit performs the functions of fetch, decode, execute, and store.
3) Registers
Registers are the temporary storage areas for
instructions or data within the processor.Registers work under the
direction of the control unit to accept, hold and transfer
instructions or data and perform arithmetic or logical comparisons
at a high rate of speed.
8. Essential status flag and what they do
1)Carry flag.: Set if an arithmetic operation generates a carry or a borrow out of the most-significant bit of the result; cleared otherwise. This flag indicates an overflow condition for unsigned-integer arithmetic. It is also used in multiple-precision arithmetic.
2)Parity flag. Set if the least-significant byte of the result contains an even number of 1 bits; cleared otherwise.
3)Zero flag. Set if the result is zero; cleared otherwise
4)Sign flag. Set equal to the most-significant bit of the result, which is the sign bit of a signed integer. (0 indicates a positive value and 1 indicates a negative value.)