Comparch Top Level View
Comparch Top Level View
COMPUTER
FUNCTION
ABEBE A. FEBRUARY, 2021
INTRODUCTION
• Consider a processor:
• Containing a single data register, called an accumulator
(AC).
• Both instructions and data are 16 bits long;
• Convenient to organize memory using 16-bit words;
EXAMPLE
• Also, each data requires 16 bits and has the following representation:1
bit for sign and 15 bits for magnitude
EXAMPLE
• In textual form:
• The PC contains value 300, the address of the first instruction.
• This instruction (the value 1940 in hexadecimal) is loaded into the instruction register IR, and the PC is
incremented;
• The first 4 bits (first hexadecimal digit) in the IR indicate that the AC is to be loaded.
• The remaining 12 bits (three hexadecimal digits) specify the address (940) from which data are to
be loaded.
• The next instruction (5941) is fetched from location 301, and the PC is incremented.
• The old contents of the AC and the contents of location 941 are added, and the result is stored in the AC.
• The next instruction (2941) is fetched from location 302, and the PC is incremented.
• The contents of the AC are stored in location 941.
CLASS WORK
• There exists some situations where we may want to interrupt the CPU:
• Program: arithmetic overflow, division by zero, segfault, etc..
• Timer: execute something periodically;
• I/O: exchange communication between I/O devices and the processor;
• Hardware: generated by a hardware failure
• e.g.: power, memory parity error, etc;
INTERRUPTS
4. After the handler finishes, the program returns to the original execution.
INTERRUPTS
• The data bus may consist of 32, 64, 128, or even more separate lines:
• a.k.a. width of the data bus;
• Used to designate the source or destination of the data on the data bus:
• The width of the address bus determines the maximum system memory;
• How much memory the CPU can address directly Ex. 32 bits
• The address lines are generally also used to address I/O addresses;
• Higher-order bits are used to select a particular module on the bus;
• Lower-order bits select a memory location or I/O port within the module.
CONTROL LINES
•System bus:
• where the main memory module is attached;
• that also connects to the cache;
• Multiplexing advantage:
• use of fewer lines, which saves space and, usually, cost.
• Multiplexing disadvantage:
• more complex circuitry is needed within each module;
• potential reduction in performance:
• certain events that share the same lines cannot take place in
parallel.
ELEMENTS OF BUS DESIGN – READING ASSIGNMENT