a. Explain what the CPU should do when an interrupt occurs. Include in your answer the method the CPU uses to detect an interrupt, how it is handled, and what happens when theinterrupt has been serviced.b. How many bits are required to address a 4M × 16 main memory if main memory is byte-addressable?c. How many bits are required to address a 1M × 8 main memory if main memory is byte-addressable?d. Explain the steps of the fetch-decode-execute cycle. Your explanation should include what is happening in the various registers.

Question
Asked Nov 17, 2019
6 views

a. Explain what the CPU should do when an interrupt occurs. Include in your answer the method the CPU uses to detect an interrupt, how it is handled, and what happens when the
interrupt has been serviced.
b. How many bits are required to address a 4M × 16 main memory if main memory is byte-addressable?
c. How many bits are required to address a 1M × 8 main memory if main memory is byte-addressable?
d. Explain the steps of the fetch-decode-execute cycle. Your explanation should include what is happening in the various registers.

check_circle

Expert Answer

Step 1

Note: Since we only answer up to 3 sub-parts, we’ll answer the first 3. Please resubmit the question and specify the other subparts (up to 3) you’d like to answer.

 

An interrupt is an unexpected event that alters the normal flow of process execution of an instruction in the system. It sends an input signal to the CPU that indicates an event needs immediate attention. The interrupt can be occurred due to user interrupt, hardware error, internal error, program error, time-driven error or signal from an input-output device.

Step 2

a.

If an interrupt occurs, then the CPU does the following procedures

When CPU detects an interrupt

  • it immediately suspends the execution of the current program
  • saves the state of the program.
  • Saves the variable data of the program.

Now the control of the CPU transferred to the address where interrupt occurs and the interrupt causes device ID is used as an index in the interrupt vector table.

The address of the ISR(interrupt service routine) is recovered and put in the program counter. In this way, the CPU executes the interrupt program.

After finishing the execution of interrupt, CPU re-establish the past program where it was suspended and wrapped up and the normal execution of the program continues.

Step 3

How many bits are required to address a 4M × 16 main memory when the main memory is byte-addressable.

Here M is Megabytes. The 1M is represented in the power of 2 as 220.

4 can be represented as 22.

16 bits are equal to 2 bytes and it can be represented as 21.

...

Want to see the full answer?

See Solution

Check out a sample Q&A here.

Want to see this answer and more?

Solutions are written by subject experts who are available 24/7. Questions are typically answered within 1 hour.*

See Solution
*Response times may vary by subject and question.
Tagged in

Engineering

Computer Science

Related Computer Science Q&A

Find answers to questions asked by student like you
Show more Q&A
add
question_answer

Q: required program java   Create a class called DuplicateCounter. Create an instance method called cou...

A: Program Instructions:In class DuplicateCounter, declare a map of Strings and create methods count() ...

question_answer

Q: WHAT ARE THE ADVANTAGES DUE TO PRATICAL USES OF CRYPTOCURRENCY?

A: In the last couple of years, cryptocurrency has grown tremendously as people are using this alternat...

question_answer

Q: Given the following business rules, define the relationships between entities and cardinalities:   A...

A: Relationship between entitiesHere entities are university, school, department, professor and course....

question_answer

Q: First, launch NetBeans and close any previous projects that may be open (at the top menu go to File ...

A: Open netbeans and create a new project name "AverageWithMethods", by using the below given steps:Cho...

question_answer

Q: This is my function for validating a char value. So far it doesn't accept any value. I need it to ac...

A: A C++ program for validating a char value is as follows,//Declare headre files#include <iostream&...

question_answer

Q: Write a C program that converts an uppercase character to alowercase character. Declare functionchar...

A:  To solve this question following variables and function should be required:Variables: ch, char and ...

question_answer

Q: All programming languages have a loop capability. Looping is the program logic’s ability to repeat o...

A: Program://inlcude the header files#include <iostream>using namespace std; //definition of main...

question_answer

Q: In the table Enrollments (studentID, courseNo, sectionNo, grade, status), which of the followingfunc...

A: Functional dependencyA functional dependency is a relationship between two attributes mainly between...

question_answer

Q: Please use Python Write a program that determines the cost of painting the walls of a windowless roo...

A: Below is the approach and code of a python program to calculate the cost of the painting of windowle...