| | |

Computer Organization and Architecture

Logic Gates

Circuits to Truth Tables

Circuits to Expressions

Expressions to Circuits

Finding SOP from K-Map

Finding POS from K-Map

Finding SOP from K-Map having Don't Care

Half Adders

Full Adders

Flip Flop

Integrated Circuits

Decoders

Multiplexers

Registers

Counters

RAM

ROM

Number Systems

Complements

Number Representations

Binary Addition and Subtraction

Gray Codes

Error Detection Codes

Register Transfer Language

Bus and Memory Transfers

Arithmetic Micro-operations

Logical Micro-operations

Shift Micro-operations

Basic Computer Organization

Timing and Control

Instruction Cycle

Instruction Types

Interrupt Cycle

Complete Computer Description

General Register Organization

Stack Organization

Evaluation of Arithmetic Operations

Address Modes

Instruction Formats

RISC and CISC Architectures

Parallel Processing

Multiplication Algorithms

Logic Gates

Circuits to Truth Tables

Circuits to Expressions

Expressions to Circuits

Finding SOP from K-Map

Finding POS from K-Map

Finding SOP from K-Map having Don't Care

Half Adders

Full Adders

Flip Flop

Integrated Circuits

Decoders

Multiplexers

Registers

Counters

RAM

ROM

Number Systems

Complements

Number Representations

Binary Addition and Subtraction

Gray Codes

Error Detection Codes

Register Transfer Language

Bus and Memory Transfers

Arithmetic Micro-operations

Logical Micro-operations

Shift Micro-operations

Basic Computer Organization

Timing and Control

Instruction Cycle

Instruction Types

Interrupt Cycle

Complete Computer Description

General Register Organization

Stack Organization

Evaluation of Arithmetic Operations

Address Modes

Instruction Formats

RISC and CISC Architectures

Parallel Processing

Multiplication Algorithms

Polish mathematician ** Lukasiewicz** was the first to propose that the arithmatic expressions can be written in some different ways as well. His proposals were:

The detailing of arithmatic notations are as follows:

### Infix

### Prefix

### Postfix

The operator resides in between two adjacent operands. This in in accordance that an entire expression (if in bracket), is an like an operand. __Ex: A + B__

The operator resides immediately before the two continuous operands. __Ex: + A B__

The operator resides immediately after two continuous operands. __Ex: A B +__

The translation works in a specific manner. We use two registers and a stack here. The registers are to store infix and postfix expressions respectively while the stack for storing operators as encountered during translation. The detailed algorithm is as follows:

- Store the infix expression in register R1 and use R2 for storing postfix notation as we build it.
- From Left to Right, extract an element of R1 and do the following:
- If it is an operand, append it into the register R2.
- Else if it is an operator, do the following:
- If the stack is empty, PUSH it onto the stack.
- Else if the precedence of this operator is higher than the operator on TOS, PUSH it on to the stack.
- Else if the precedence of this operator is lower than the operator on TOS, POP the TOS, append in R2 and goto step b.
- Else if the precedence of this operator is equal to the TOS, POP the TOS append in R2 and goto step b.
- Else if it is an opening paranthesis PUSH it on to the stack, start a new stack hierarchy untill an closing paranthesis is found and goto step 2.
- Else if it is a closing paranthesis, POP every operator on stack untill the opening paranthesis is found.
- Else if reached on End of Expression, POP every operator remaining on the stack and append in R2.
- End of algorithm.

The algorithm is as follows:

- Do a horizontal mirror reflection to the Infix expression first.
- Now from left to right extract every element and do perform exactly the Infix to Postfix conversion.
- The result after a while is a Postfix form of the mirrored expression.
- Finally recalling that the expression was mirrored in step 1, do again another horizontal mirror reflection to the obtained Postfix expression. The final result is corresponding Prefix form of the original Infix expression.

First we do horizontal mirror reflection and we get: __F / E - D % C * B + A__

Once again we do horizontal mirror reflection and we get our result as: __+ A - * B % C D / E F__

First we do horizontal mirror reflection and we get: __( F / E - D % C ) * B + A__

Once again we do horizontal mirror reflection and we get our result as: __+ * B - % C D / E F__

The algorithm is as follows:

- Create a stack to store operands continuously.
- PUSH every operand in to the stack as it is encountered from left to right.
- If an operator is encountered, it will not be PUSHed, instead, it will be performrd over two continuous TOS elements.
- Repeat the steps till the end of expression.

Copyright 2018. All Rights Reserved.