Question

4. What is a stack in a microprocessor? What is the major different between a stack and a FIFO(First-In-First-Out)? Please ex
0 0
Add a comment Improve this question Transcribed image text
Answer #1

STACK --

It is a LIFO (last in, first out) data structure implemented in the RAM area and is used to store addresses and data when the microprocessor branches to a subroutine. Then the return address used to get pushed on this stack. Also to swap values of two registers and register pairs we use the stack as well

DIFFERENCE BETWEEN STACK AND FIFO--

STACK

1. A stack is a linear data structure in which elements can be inserted and deleted only from one side of the list, called the top

2. A stack follows the LIFO (Last In First Out) principle, i.e., the element inserted at the last is the first element to come out

3. The insertion of an element into stack is called push operation, and deletion of an element from the stack is called pop operation

4. In stack we always keep track of the last element present in the list with a pointer called top.

FIFO

1. linear data structure in which elements can be inserted only from one side of the list called rear, and the elements can be deleted only from the other side called the front.

It is called a queue.

2. The queue data structure follows the FIFO (First In First Out) principle, i.e. the element inserted at first in the list, is the first element to be removed from the list.

3. In queue ( FIFO technique) we always maintain two pointers, one pointing to the element which was inserted at the first and still present in the list with the front pointer and the second pointer pointing to the element inserted at the last with the rear pointer

STACK POINTER --

A stack pointer is a small register that stores the address of the last program request in a stack. A stack is a specialized buffer which stores data from the top down.

Stack pointer holds the address of the last accupied memory location of the stack called stack pointer.

It is used to save the contents of register if it is required during the execution of a program.

It indicates which memory location onward the stack is vacent for further storage.

Any area of RAM can be used as stack.

Add a comment
Know the answer?
Add Answer to:
4. What is a stack in a microprocessor? What is the major different between a stack...
Your Answer:

Post as a guest

Your Name:

What's your source?

Earn Coins

Coins can be redeemed for fabulous gifts.

Not the answer you're looking for? Ask your own homework help question. Our experts will answer your question WITHIN MINUTES for Free.
Similar Homework Help Questions
  • Answer based on microprocessor 8086 (10) LEA BX, CX 7. Suppose that (AX)-4AOBH, the content of...

    Answer based on microprocessor 8086 (10) LEA BX, CX 7. Suppose that (AX)-4AOBH, the content of [1020H] storage unit is 260FH. Try to determine the results of the following instructions. (1) MOV AX, 1020H (AX) (2) XCHG AX, [1020H) ; (AX) (3) MOV AX, [1020H) ;(AX)=- (4) LEA AX, [1020H) ; (AX) 10. Suppose the size of the stack segment is 256 bytes. The starting address of the stack is 1250: 0000H, assuming there are 5 word-sized data in the...

  • Post lab Questions 1) Write briefly about ARM architecture? 2) What is the difference between RISC...

    Post lab Questions 1) Write briefly about ARM architecture? 2) What is the difference between RISC and CISC? 3) What is the difference between Microprocessor and Microcontroller? 4) What are the different layers involved in software? Explain more about it? 5) What are the different stages involved in software development? Explain more about it? 6) What are the core peripherals of the cortex M4 microprocessor? 7) What are the different components of CPU? Explain briefly about each component?

  • Note: The question needs to be answered in "C Programming Languange ". And after the question fin...

    Note: The question needs to be answered in "C Programming Languange ". And after the question find 3 pages for needed informations. Spring CE4717 Language Processors Q1. Consider the following LEx program. return R1 return R2 return R3 return R4 return R5; return R6; IA-2a-z)[A-Za-z0-9]- -2 10-91+ 10-9a-EA-FI Ihi] [01] [01] 이삐 t Vtin) int main (void) int tcode; do f tcode -yylex()i printf ("token type td \"%s\"\n", tcode, yytext); ) while (tcode)i return 0; i. Explain the steps needed...

  • LC-3 Programming Help!! The Stack Protocol The following outline is the protocol for passing arguments to...

    LC-3 Programming Help!! The Stack Protocol The following outline is the protocol for passing arguments to a function and returning values. Everything is stored on the runtime stack so that space is used only when the function is executing. As a result the actual address of arguments and locals may change from call to call. However, the layout of the stack frame (activation record) is constant. Thus, the offests from the frame pointer (FP) to the parameters/locals are constant. All...

  • 1. There are two different types of inventory systems--perpetual and periodic. What is the difference between...

    1. There are two different types of inventory systems--perpetual and periodic. What is the difference between the two in terms of how inventory is tracked and how it is recorded on the books. 2. In regards to inventory costing methods (LIFO, FIFO, Weighted Average), in most situations, the flow of goods would actually resemble FIFO. For example, a grocery store will push the oldest milk to the front of the shelf to try to sell it first. If that is...

  • Please list at least 5 major differences between Managerial and Financial Accounting. Include in your discussion...

    Please list at least 5 major differences between Managerial and Financial Accounting. Include in your discussion who the important players are in each, who is using the information, and what type of information is everyone focused on. Please explain why each type of accounting (managerial and financial) plays an important role in the organization.

  • What is the principle difference in behavior between a stack and a queue? a stack preserves...

    What is the principle difference in behavior between a stack and a queue? a stack preserves the order in which items are added whereas a queue reverses order there is no difference a stack reverses the order in which items are added whereas a queue preserves order xa stack does nothing whereas a queue can preserve and reverse the order that items are added to it Fill in the blank in the following sentence with one of the answers listed....

  • 5. (34 pts) Stacks and Queues a. Stacks and queues are similar and different. For each of stack a...

    5. (34 pts) Stacks and Queues a. Stacks and queues are similar and different. For each of stack and queue, give a drawing showing how each would be stored in an array and a linked list. Use your first name (or usual nickname) as the data put into the container as an example for your pictures. Label the accessible element. (4 pictures; 16 pts) the text and lecture. (10 pts) You will not receive full credit without appropriate stack pictures....

  • What is the angle between the following two hybrid orbitals on the same atom? sp and...

    What is the angle between the following two hybrid orbitals on the same atom? sp and sp hybrid orbitals: ______________ degrees sp^2 and sp^2 hybrid orbitals:____________ degrees sp^3 and sp^3 hybrid orbitals:_____________ degrees please explain, thank you.

  • Which of the following terms is NOT associated with a stack? push top get bottom Flag...

    Which of the following terms is NOT associated with a stack? push top get bottom Flag this Question Question 21 pts Which of the following terms is NOT associated with a queue? add front FIFO enqueue pop Flag this Question Question 31 pts A stack exhibits what kind of behavior? Last In, First Out (LIFO) First In, First Out (FIFO) Last In, Last Out (LILO) Read-Only Write-Only Flag this Question Question 41 pts What are the final contents of myQueue...

ADVERTISEMENT
Free Homework Help App
Download From Google Play
Scan Your Homework
to Get Instant Free Answers
Need Online Homework Help?
Ask a Question
Get Answers For Free
Most questions answered within 3 hours.
ADVERTISEMENT
ADVERTISEMENT
ADVERTISEMENT