Academic Integrity: tutoring, explanations, and feedback — we don’t complete graded work or submit on a student’s behalf.

What is a postfix notation? give 2 examples of postfix notation. give 1 advantag

ID: 3812430 • Letter: W

Question

What is a postfix notation? give 2 examples of postfix notation. give 1 advantage of postfix notation. Show how the hexadecimal number 78 34 60 78 will be stored in little and big endian machines. Write the following expression in postfix (reverse Polish) notation A - B + C times (D times E - F)/G + H times K Suppose that 1M * 16 main memory is built using 128KB * 16 RAM chips and memory is word-addressable. How many RAM chips are necessary? How many RAM chips are there per memory word? How many address bits are needed for each RAM chip? How many banks will this memory have? If an instruction contains four addresses, what might be the purpose of each address? What is the difference between big endian and little endian? What technique will you use to reduce the instruction set size and also reduce the execution time the instruction format 9 bytes below. Briefly explain.

Explanation / Answer

Ques 2:

a) Postfix Notation :

Postfix notation or Reverse Polish notation is one of the possible orderings of functions and operands. In postfix notation, the functions are preceded by their operands. For Example, '1+2' becomes '12+'. Postfix notations are well suited for stack based architectures. The best known postfix syntax is FORTH, RPL etc.

b) Examples of Postfix notations

c) Advantage of Postfix Notation
The computation of a postfix expression is easier by using a stack. It does not have overhead of parentheses. Evaluating an expression in postfix notation requires scanning from left to right and putting the numbers in stack until you get an operator. If you get the operator, pop the latest two numbers from the stack and do the calculations. This is how we can repeat the process and evaluate the expression easily.

d) Hexadecimal Number stroing

The hexadecimal number -> 7834607816. Since each hex digit is 4 bits, we need 8 hex digits to represent the 32 bit value. So, the 4 bytes are 78, 34, 60, 78 where each byte requires 2 hex digits.

Little Endian

In little Endian, it will store the least significant byte in the smallest address. Here's how it would look like:

  Big Endian

In Big Endian, it will store the most significant byte in the smallest address. Here's how it would look like:

Notice that this is in the reverse order compared to Little Endian.

e) Infix to Postfix expression

     A-B+C*(D*E-F) / G+H*K
-> (A - (B + (C *((D*E)-F)))) / (G+(H*K))
-> (A - (B + (C * ((DE*)-F)))) / (G + (HK*))

-> (A - (B + (C * (DE*F-)))) / (GHK*+)
   -> (A - (B + (CDE*F-*))) / (GHK*+)
   -> (A - ( BCDE*F-*+)) / (GHK*+)
   -> (ABCDE*F-*+-) / (GHK*+)
   -> ABCDE*F-*+-GHK*+/

Answer is -> ABCDE*F-*+-GHK*+/

Address Value 1000 78 1001 60 1002 34 1003 78
Hire Me For All Your Tutoring Needs
Integrity-first tutoring: clear explanations, guidance, and feedback.
Drop an Email at
drjack9650@gmail.com
Chat Now And Get Quote