Вы находитесь на странице: 1из 8

University of Negros Occidental-Recoletos Sc or e

COLLEGE OF INFORMATION TECHNOLOGY


Computer Organization and Operating Systems
QUIZ 1 January 7, 2017
AARON WILLIAM S. SMALLEY
Fir s t Na me M. I . L as t N am e R em ar ks

1. Discuss the differences between data buses, address buses, and control buses. (30 pts)

Data Bus is intended to transfers instructions coming from or going to the processor. It is a
bidirectional bus. This also contains the contents that have been read from the memory location or are to
be written into the memory location. The data bus also works as address bus when multiplexed with
lower order address bus. Data bus is 8 Bits long. Address Bus determines the location in memory that the
processor will read data from or write data to. It also transports memory addresses which
the processor wants to access in order to read or write data. It is a unidirectional bus. Address bus has a
16 bit long that can transfer maximum 16 bit address which means it can address thousands of different
memory locations. Control Bus manages the information flow between components indicating whether
the operation is a read or a write and ensuring that the operation happens at the right time and also
transports orders and synchronization signals coming from the control unit and travelling to all other
hardware components. It is a bidirectional bus, as it also transmits response signals from the hardware.
This is a dedicated bus, because all timing signals are generated according to control signal.

2. Discuss the operation of control unit during program execution (10 pts)

Control unit coordinates the transfer of data between registers of CPU or microprocessor and
ALU. Control unit serves the instructions for ALU. Along with this, control unit, as its name
implies, controls every other parts of the machine, their coordinations, traffic etc. Thus control
unit controls the complete work-flow of the CPU. But control unit doesn't take inputs, give
outputs, process data or store data itself, what control unit do is, it controls these operations when
they are performed by respective devices. The purpose of control unit to run the whole computer.
And control unit is run by the instructions stored in RAM and ROM. So, control unit receives
instructions which are stored in RAM and ROM and controls operations of other connected units
or devices through those instructions.
Operations of Control Unit:
1. Fetching instructions one by one from primary memory and gather required data and operands
to perform those instructions.
2. Sending instructions to ALU to perform additions, multiplication etc.

Prepared by: Rogy T. Acosta, MSCS|Page 1 of 8


3. Receiving and sending results of operations of ALU to primary memory
4. Fetching programs from input and secondary memory and bringing them to primary memory
5. Sending results from ALU stored in primary memory to output.

3. What is an interrupt? What causes one to occur? (20 pts)

An event external to the currently executing process that causes a change in the normal flow of
instruction execution; usually generated by hardware devices external to the CPU. An interrupt
is a signal informing a program that an event has occurred. When a program receives an interrupt
signal, it takes a specified action which can be to ignore the signal. Interrupt signals can cause a
program to suspend itself temporarily to service the interrupt. The interrupt is just a way of telling the
processor or the OS that it is ready, or it has new input, etc. So sometime during init, the OS is waiting
for sub-systems to be ready, and an interrupt from these sub-systems would indicate exactly that. So
that is what the "event" relates to.

Interrupt signals can come from a variety of sources. For example, every keystroke generates an
interrupt signal. Interrupts can also be generated by other devices, such as a printer, to indicate that
some event has occurred. In regard to hardware or software interrupts, hardware interrupts are those
which come from the hardware. Input and Output devices like keyboard, mouse, printer, USB sticks,
etc. A hardware interrupt causes the processor to save its state and begin execution of interrupt handler.
On the other hand, software interrupts are instructions in the instruction set, which causes the processor
to change its privilege level from user-supervisor, also known as context-switch.

4. What is the importance of the Principle of Equivalence of hardware and software? (10 pts)

The principle of equivalence of hardware and software states that anything than can be done with
software can also be done with hardware and vice versa. This is important in designing the architecture of

Prepared by: Rogy T. Acosta, MSCS|Page 2 of 8


a computer. There are probably uncountable choices to mix and match hardware with software. But
knowing this principle, one can make the right choices by considering other external factors like costs,
speed and function, to determine the most suitable programs for completing specific tasks thus
maximizing the performance of the computer. Sometimes all you need is simple system to give better
performance than a complicated program which might slow down the computer.

5. Draw and label the Von Neumann architecture? Discuss its major influences in current
modern computing. (15 pts)

CENTRAL PROCESSING UNIT


CONTROL UNIT

ALU
INPUT (ARITHMETIC LOGIC UNIT) OUTPUT
DEVICES DEVICES

MEMORY UNIT

Von Neumann did not invent the computer, but what he introduced was equally significant: computing by
use of computer programs, the way we do it today. The roots of this invention lay not in electronics but in
the higher reaches of mathematics, in a problem that tantalized specialists in mathematical logic during
the early decades of the 20th century: the challenge of establishing basic foundations for math. These
would take the form of an explicit set of definitions and axioms, or fundamental statements, from which
all known results might be derived. With the end of the Second World War, the world saw a shift in focus
from Europe to America, in terms of culture, economics and military strength. That situation continues to
this day, due in no small measure to the development of sophisticated computing technologies that rest
upon the shoulders of the giants who laid the first bricks in the foundations, the foundations of computing.

Prepared by: Rogy T. Acosta, MSCS|Page 3 of 8


6. Where registers located and what are its types? Give an example for each register operation.
(30 pts)
Register are used to quickly accept, store, and transfer data and instructions that are being used
immediately by the CPU, there are various types of Registers those are used for various purpose. Among
of the some Mostly used Registers named as AC or Accumulator, Data Register or DR, the AR
or Address Register, program counter(PC), Memory Data Register (MDR) ,Index register, Memory
Buffer Register.

These Registers are used for performing the various Operations. While we are working on the System
then these Registers are used by the CPU for Performing the Operations. When We Gives Some Input to
the System then the Input will be Stored into the Registers and When the System will gives us the Results
after Processing then the Result will also be from the Registers. So that they are used by the CPU for
Processing the Data which is given by the User.

Registers Perform:

1) Fetch: The Fetch Operation is used for taking the instructions those are given by the user and the
Instructions those are stored into the Main Memory will be fetch by using Registers.

2) Decode: The Decode Operation is used for interpreting the Instructions means the Instructions are
decoded means the CPU will find out which Operation is to be performed on the Instructions.

3) Execute: The Execute Operation is performed by the CPU. And Results those are produced by the CPU
are then Stored into the Memory and after that they are displayed on the user Screen.

Example of Registers:

MAR stand for Memory Address Register

This register holds the memory addresses of data and instructions. This register is used to access data and
instructions from memory during the execution phase of an instruction. Suppose CPU wants to store some
data in the memory or to read the data from the memory. It places the address of the-required memory
location in the MAR.

Program Counter

The program counter (PC), commonly called the instruction pointer (IP) in Intel x86 microprocessors, and
sometimes called the instruction address register, or just part of the instruction sequencer in some
computers, is a processor register

It is a 16 bit special function register in the 8085 microprocessor. It keeps track of the next memory
address of the instruction that is to be executed once the execution of the current instruction is
completed. In other words, it holds the address of the memory location of the next instruction when the
current instruction is executed by the microprocessor.

Accumulator Register

This Register is used for storing the Results those are produced by the System. When the CPU will
generate Some Results after the Processing then all the Results will be Stored into the AC Register.

Prepared by: Rogy T. Acosta, MSCS|Page 4 of 8


Memory Data Register (MDR)

MDR is the register of a computers control unit that contains the data to be stored in the computer
storage (e.g. RAM), or the data after a fetch from the computer storage. It acts like a buffer and holds
anything that is copied from the memory ready for the processor to use it. MDR hold the information
before it goes to the decoder.

MDR which contains the data to be written into or readout of the addressed location. For example, to
retrieve the contents of cell 123, we would load the value 123 (in binary, of course) into the MAR and
perform a fetch operation. When the operation is done, a copy of the contents of cell 123 would be in the
MDR. To store the value 98 into cell 4, we load a 4 into the MAR and a 98 into the MDR and perform a
store. When the operation is completed the contents of cell 4 will have been set to 98, by discarding
whatever was there previously.

The MDR is a two-way register. When data is fetched from memory and placed into the MDR, it is
written to in one direction. When there is a write instruction, the data to be written is placed into the MDR
from another CPU register, which then puts the data into memory.

The Memory Data Register is half of a minimal interface between a micro program and computer storage,
the other half is a memory address register.

Index Register

A hardware element which holds a number that can be added to (or, in some cases, subtracted from) the
address portion of a computer instruction to form an effective address. Also known as base register. An
index register in a computer's CPU is a processor register used for modifying operand addresses during
the run of a program.

Memory Buffer Register

MBR stand for Memory Buffer Register. This register holds the contents of data or instruction read from,
or written in memory. It means that this register is used to store data/instruction coming from the memory
or going to the memory.

Data Register

A register used in microcomputers to temporarily store data being transmitted to or from a peripheral
device.

7. What are the pros and cons of fixed-length and variable-length instructions? Which is
currently more popular? (15 pts)
Pros of fixed length instructions
- Easy decode (simple pipeline). In particular it is simple to decode several instructions in
parallel, as decode of the second and subsequent instructions doesn't depend on decode of the
first. There have been suggestions of getting around this problem by example having only a few
possible lengths and speculatively decode at all potential instruction borders.
- Word aligned instructions behave better as branch targets and w.r.t. I-cache lines. With fixed-

Prepared by: Rogy T. Acosta, MSCS|Page 5 of 8


length instructions, all instructions are naturally word-aligned. This assumes that instruction
length == word length. If this is not the case, this advantage is lessened.
Pros of variable length instructions:
- Can be made more compact, as commonly used instructions can be given shorter codes than
rarely used instructions. This is, however, a fairly small advantage, as designs that used fixed-
length 16-bit instructions (e.g. Thumb) typically compare well to variable-length encodings.
- Easier to extend instructions set. Basically, you just need one encoding that isn't used to extend
the instruction set with an arbitrary number of arbitrarily complex instructions, simply by using
the previously unused encoding as prefix to the new instructions. However, this hurts
compactness of code.

Therefore:
Fixed length instructions means there is a constant amount by which the instruction pointer must
be incremented after each fetch. With a variable length instruction, the control unit must check
the op code of each fetched instruction to determine the proper increment value. Variable Length
complicate instructions, while fixed length can waste memory. RISC tend toward fixed length,
while CISC tend toward the more complexVariable Length.

8. Name and explain the two types of memory interleaving and the differences between
them.

High-Order Interleaving

Arguably the most natural arrangement would be to use bus lines A26-A27 as the module
determiner. In other words, we would feed these two lines into a 2-to-4 decoder, the outputs of
which would be connected to the Chip Select pins of the four memory modules. If we were to do
this, the physical placement of our system addresses. High order interleaving uses the high order
bits as the word address within each module.

Low-Order Interleaving
An alternative would be to use the low bits for that purpose. In our example here, for instance,
this would entail feeding bus lines A0-A1 into the decoder, with bus lines A2-A27 being tied to
the address pins of the memory modules. Low order interleaving spreads contiguous memory
across the modules horizontally. This implies that the low order bits of the memory address are
used to identify the memory module. High order bits are the word addresses (displacement)
within each module.

Prepared by: Rogy T. Acosta, MSCS|Page 6 of 8


Prepared by: Rogy T. Acosta, MSCS|Page 7 of 8
--- End of Quiz1 ---

Prepared by: Rogy T. Acosta, MSCS|Page 8 of 8

Вам также может понравиться