Monday, 22 August 2022

Updating Java Programming soon

 Hi,

Returning back to the Blog after a long time.

Java programming will be started soon in a few days. I will updated the pages as soon as they are ready.

Hope for the best.

Thank you.

Monday, 21 February 2022

Simplification of Boolean Expressions

Boolean Algebra is all about simplifying the boolean expressions and write them in their smallest form so that execution takes minimum time and required minimum space.

Boolean expressions are simplified in 2 ways. First way is using laws of boolean algebra and the other way is using K-maps

This portion covers the ways to simplify the boolean expressions using laws of boolean algebra.

** Please click to visit the page.

Any problem or issue in understanding the topic is most welcome. Please share it in the comment box and I will resolve it for you.

Thank You.


Multiplexer (MUX)

Multiplexers are combinational logic circuit which directs multiple input lines to a single output line. In other words we can say that multiplexer is a combinational circuit which accepts input from multiple input lines but only have single output line to produce the output.

This part will cover all types of multiplexers and their working

** Please visit the page on right side menu for topic details.

Any problem or issue in understanding the topic is most welcome. Please share it in the comment box for resolution.

Thank You.

Infix to Post/ Prefix Expression

Expressions:  They are calculations involving operators and operands.
                        example: A+B%C*D++.

Infix Expressions:  these are basic expressions containing 1 operator between 2 operands.
                        example:   A-B
                                         (A+B)%(C*D).

Postfix Expressions:  these expressions are formed by placing the operator after both operands.
                        example:  1)  AB+
                                         2) (AB+)(CD*)%.
                        
in example 1 you can clearly see that there is addition between A and B, but "+" is placed after both the operands, thus making it a postfix expression.
in example 2 there are three calculations:
                                                                1) A+B, written as AB+
                                                                2) C*D, written as CD*
                                                                3) 1)%2), written as (AB+)(CD*)% 
thus making it a prefix expression.

Prefix Expressions:  these expressions are formed by placing the operator before both the operands.
                        example:    +AB                      
in the given example you can see that there is an addition between A and B, but "+" is placed before both the operands, thus making it a prefix expression.


Infix to Postfix/ Prefix Conversion:

Before converting an Infix expression to Post/ Prefix expression we should be aware of 2 things:

1)    Placement of Brackets:    
        Before converting any infix expression to pre/ postfix expression, every individual calculation should be placed in brackets according to its operator precedence.

2)    Operator precedence:    
        This is related to the execution priority of operators. Following is the operator precedence while converting an expression:
                               

The above table is showing the operator precedence from high to low. Operators in same cell have same priority and if they occurs consecutively then they must be executed from left to right order as there occurrence in the expression.

Infix to Postfix:
It has 2 steps:
                       a)    Place brackets correctly         
                       b)    Execute all brackets one by one from innermost to outer one.

let us understand the same with an example:
            Infix Expression :    A + B * C / (E - F)
            Postfix Conversion:    A + (B * C) / (E - F)        : place B*C in bracket as * & / have same priority, but * occurs to left

                                               A + ((B * C) / (E - F))      : place operands with / in bracket
now execute:
                                               A + ((B * C) / (E - F))
                                           =  A + ((BC*) / (EF-))       : place * after B&C, also - after E&F
                                           =  A + (BC * EF- /)           : now place / between both operands (BC*) and (EF-)                                         
                                            =  ABC * EF- /+          : finally place + after both operands (A) and (BC * EF- /)

Infix to Prefix:
It also has 2 steps similar to previous conversion.
so, let us understand the same with an example:

            Infix Expression :    A + B * C / (E - F)
            Prefix Conversion:    A + (B * C) / (E - F)        : place B*C in bracket as * & / have same priority, but * occurs to left

                                               A + ((B * C) / (E - F))      : place operands with / in bracket
now execute:
                                               A + ((B * C) / (E - F))
                                            =  A + ((*BC) / (-EF))       : place * before B&C, also - before E&F
                                            =  A + (/ * BC - EF)           : now place / between both operands (*BC) and (-EF)                
                                            =  +/ * BC - EF             : finally place + before both operands (A) and (/ * BC - EF)

Practice Question:
Convert the following infix expressions to postfix expression
1)    A+B*C%D/E-F/(G+H)
Solu:    first place the brackets,
let us see in detail how brackets are placed,
                  =  A+B*C%D/E-F/(G+H)
since *, /, % have same priority so we will approach left to right rule, here * is at leftmost position so it will be enclosed first,
                  = A+(B*C)%D/E-F/(G+H)
now % operation will be enclosed,
                  = A+((B*C)%D)/E-F/(G+H)
now both / operations
                  = A+(((B*C)%D)/E)-(F/(G+H))
now we have + & - operations with same priority, but + is at left position so it will be enclosed first.
                  = (A+(((B*C)%D)/E))-(F/(G+H))
now, solve all brackets one by one from innermost to outer one.
                  = (A+(((BC*)%D)/E))-(F/(GH+))
                  = (A+((BC*D%)/E))-(FGH+/)
                  = (A+(BC*D%E/))-(FGH+/)
                  = (ABC*D%E/+)-(FGH+/)
finally, execute last operation( subtraction)
                  = ABC*D%E/+FGH+/-
**********************************************************************************************************

Saturday, 12 February 2022

Decoder

 Decoder:

It is a combinational logic circuit which does opposite of Encoder. A decoder converts a binary number to its equivalent decimal or hexadecimal number.

Types of Decoder:

We will study following types of decoders:

        1)    2 to 4 Decoder        (2 inputs and 4 outputs)

        2)    3 to 8 Decoder        (3 inputs and 8 outputs)

        3)    4 to 16 Decoder        (4 inputs and 16 outputs)

2 to 4 Decoder:

Since 2 binary bits can store a maximum of 3 in decimal number system, thus a 2 to 4 decoder has 2 input lines which accepts 4 set of truth values and generates 4 decimal numbers (0 to 3) as output.

It can be represented by the following rule:
                    Number of Outputs = 2n, where n= Number of Inputs
     thus if inputs are 2, then output values are 2i.e. 4,
similarly if inputs are 3, then output values are 2i.e. 8.

Truth Table for 2 to 4 Decoder:

Input

Output

x

y

D3

D2

D1

D0

0

0

0

0

0

1

0

1

0

0

1

0

1

0

0

1

0

0

1

1

1

0

0

0

In the above truth table the gate against the set of input values representing equivalent decimal number gets output value 1.
for example: when we pass values for input x & y as 1 & 0 respectively then gate D2 will get its value 1 against the input set as 10 is decimal equivalent of 2.

Logic Circuit & Block diagrams for 2 to 4 Decoder:

Here is the logic circuit and Block diagrams of a 2 to 4 Decoder:

Logic Circuit Diagram



Block Diagram

3 to 8 Decoder:

A 3 to 8 decoder has 3 input lines for binary number as input and it generates 8 decimal values as output.

Truth Table for 3 to 8 Decoder:

Input

Output

x

y

z

D7

D6

D5

D4

D3

D2

D1

D0

0

0

0

0

0

0

0

0

0

0

1

0

0

1

0

0

0

0

0

0

1

0

0

1

0

0

0

0

0

0

1

0

0

0

1

1

0

0

0

0

1

0

0

0

1

0

0

0

0

0

1

0

0

0

0

1

0

1

0

0

1

0

0

0

0

0

1

1

0

0

1

0

0

0

0

0

0

1

1

1

1

0

0

0

0

0

0

0


Logic Circuit & Block diagrams for 3 to 8 Decoder:

Here is the logic circuit and Block diagrams of a 3 to 8 Decoder:

Block Diagram

Logic Circuit Diagram

****************************************************************************************