CAO Theory

Download as docx, pdf, or txt
Download as docx, pdf, or txt
You are on page 1of 4

Name:

Registration Number:
Course: Computer Organization and Assembly Language (Theory)
Program: BS (Computer Science)
Teacher: Dr. Asim

Q.1)

First step is pc have content 300, where 300 is first command from memory, after that
command will be change become hexadecimal in the memory, so number 300 become 1940.
Number 1940 will be move in the cpu register in the IR(instruction register).
In step 2 ac(temporary storage) have content 0003, why ?, because the last 3 digit is a 940 is
0003, and the hexadecimal is 1940 so we using 940 because the last 3 digit number from
hexadecimal 1940 is 940 and 940 have content 0003.
Step 3 actually almost same with step 1, pc have content 301 and change hexadecimal
become 5941 and will be move in cpu register the place is IR . the content pc is 301, and the
content from AC still 0003.
Pc have content 302 so the hexadecimal is 2940 but the IR is still 5941, and Ac will be
change become 0005 ?, where we can find 0005 ?, 0005 is sum from hexadecimal 940 is
0003 and hexadecimal from 941 is 0002 so the result is 0003 + 0002 = 0005.
Step 5 is pc have content 302 after that hexadecimal is 2940 so move in IR, and AC is still
0005.
Step 6, The last step is from cpu register we have content pc is 303, AC is 0005, and IR is
2940, so from cpu register have ac 0005 will be move in memory change hexadecimal 941 =
0002 become 941 = 0005.
Q.2)

A second approach is to define priorities for interrupts and to allow an interrupt of higher
priority to cause a lower-priority interrupt handler to be itself interrupted . As an example of
this second approach, consider a system with three I/O devices: a printer, a disk, and a
communications line, with increasing priorities of 2, 4, and 5, respectively. Based on an
example in [TANE97], illustrates a possible sequence. A user program begins at t 0. At t 1, a
printer interrupt occurs; user information is placed on the system stack and execution
continues at the printer interrupt service routine (ISR).While this routine is still executing, at
t 2, a communications interrupt occurs. Because the communications line has higher priority
than the printer, the interrupt is honored. The printer ISR is interrupted, its state is pushed
onto the stack, and execution continues at the communications ISR. While this routine is
executing, a disk interrupt occurs (t 3). Because this interrupt is of lower priority, it is simply
held, and the communications ISR runs to completion.When the communications ISR is
complete (t 4), the previous processor state is restored, which is the execution of the printer
ISR. However, before even a single instruction in that routine can be executed, the processor
honors the higherpriority disk interrupt and control transfers to the disk ISR. Only when that
routine is complete (t 5) is the printer ISR resumed.When that routine completes (t 6), control
finally returns to the user program.
Q.3)

You might also like