computer orgranisation – Programmerbay https://programmerbay.com A Tech Bay for Tech Savvy Sun, 10 Mar 2024 16:46:31 +0000 en-US hourly 1 https://wordpress.org/?v=6.5.5 https://programmerbay.com/wp-content/uploads/2019/09/cropped-without-transparent-32x32.jpg computer orgranisation – Programmerbay https://programmerbay.com 32 32 Design 2 bit synchronous up down counter using T flip flop? https://programmerbay.com/design-2-bit-synchronous-up-down-counter-using-t-flip-flop/ https://programmerbay.com/design-2-bit-synchronous-up-down-counter-using-t-flip-flop/#respond Fri, 01 Mar 2024 17:29:00 +0000 http://programmerbay.com/?p=3111

These are the following steps to design 2 bit synchronous up down counter using T flip flop:

Step 1: To design a synchronous up-down counter, we need one extra input called control input. Other than this, in next state column, half of the input must be appeared as up counter and the remaining must be treated as a down counter.

Step 2: After that, we need to construct a state table with excitation table.

Note: To construct excitation table from state table you should know the excitation table of respective flip flop, in this case, it is T flip flop. So check the excitation table for T flip flop Which is:

T Flip Flop Excitation Table

Present stateNext State    T
000
011
101
110

So, the above table is the excitation table for T Flip Flop.


State Table with  excitation  table

   Control input   Present State    Next State    Flip Flop
CiQ2Q1Q'2Q'1T2T1
0000101
0011011
0101101
0110011
1001111
1010001
1100111
1111001

Above the table is created as per follow :

When Q2 =0 which is the present state and Q2‘=0 which is next state then T2 become 0 [As per excitation table, have a look ]
Similarly, if Q2 is 0 and Q2‘ is 1 then T2 becomes 1.
In a similar way, it goes on .

Step 3: After making the excitation table the next thing  to do is dig out the equation from the boolean algebra or K map for the design of the counter. So, for T1 and  T2we got 1, and Q1‘.Ci + Q1.Ci’

K-Map

 

 

For T2  Flip flop,

2 2Bbit 2Bup 2Bdown1

 

T2= Q1‘.Ci + Q1.Ci’

For TFlip flop,

2 2Bbit 2Bup 2Bdown2

 

T1=1

Step 4: Lastly according to the equation got from K map create the design for 2 bit synchronous up down counter.

 

2 2Bbit 2Bup 2Bdown

Related posts:

Design a 2 bit Synchronous down counter using T Flip flop?
Design a 2 bit Synchronous up counter using T Flip flop? 

]]>
https://programmerbay.com/design-2-bit-synchronous-up-down-counter-using-t-flip-flop/feed/ 0
Design 3 bit synchronous up counter using T Flip flop? https://programmerbay.com/design-a-3-bit-synchronous-up-counter-using-t-flip-flop/ https://programmerbay.com/design-a-3-bit-synchronous-up-counter-using-t-flip-flop/#respond Sun, 25 Feb 2024 16:04:00 +0000 http://programmerbay.com/?p=3114

These are the following steps to Design a 3 bit synchronous up counter using T Flip flop:

Step 1: To design a synchronous up counter, first we need to know what number of flip flops are required. we can find out by considering a number of bits mentioned in the question. So, in this, we required to make 3 bit counter so the number of flip flops required is 3 [2n where n is a number of bits].

Step 2: After that, we need to construct state table with excitation table.
Note: To construct excitation table from state table you should know the excitation table of respective flip flop, in this case, it is T flip flop. So check the excitation table for T flip flop Which is:

T Flip Flop Excitation Table

Present stateNext State    T
000
011
101
110

So, the above table is the excitation table for T Flip Flop.

State Table with  excitation  table

   Present State    Next State    Flip Flop
Q3Q2Q1Q'3Q'2Q'1T3T2T1
000001001
001010011
010011001
011100111
100101001
101110011
110111001
111000111

Above  table is created as per follow :

When Q3 =0 which is present state and Q3‘=0 which is next state then T3 become 0 [As per excitation table, have a look ]
Similarly, if Q3 is 0 and Q3‘ is 1 then T3  become 1.
In similar way it goes on .

Step 3: After making the excitation table the next thing  to do is dig out the equation from the boolean algebra or K map for the design of the counter. So, for T1 , Tand T3 we got 1,  Q1 and Q1.Q2

K-Map

 

For TFlip flop,

 

3biit
T3= Q1.Q2

For T2  Flip flop,

3bit1
T2= Q1

For TFlip flop,

3biit2t

 

T1=1

Step 4: Lastly according to the equation got from K map create the design for 3 bit synchronous up counter.

design 2B3bit

In above design, T1 is getting input 1 and T2 is getting input from the output of the T1 flip flop and lastly, T3 is getting input from the output of T1  and T2 . A clock is attached to it which is in blue colour.

Popular Posts:

SQL: INSERT INTO statement 
SELECT DISTINCT statement 

]]>
https://programmerbay.com/design-a-3-bit-synchronous-up-counter-using-t-flip-flop/feed/ 0
Define Sum of Product Form and find SOP expression from Truth Table, Boolean function And non-Canonical Expression https://programmerbay.com/sum-of-products-form/ https://programmerbay.com/sum-of-products-form/#respond Tue, 09 Jun 2020 18:05:00 +0000 http://programmerbay.com/?p=3101

What is Sum of Product form?

‘Sum of Product’ is commonly abbreviated as SOP form. When an expression is expressed in a sum of binary terms ( A term refers to a set of binary variables, where each binary variable is combined with an operation) called Minterms then it is said to be Sum of Products.

In other words, An expression consisting only of minterms is called Sum of the Product. For example, A.B+A’B is an SOP expression.
[other concept Maxterm, (A+B).(A’+B’)]

SOP can be categorized into two forms :

– Canonical or Standard SOP form: In this, each and every binary variable must have in each term. For example- A.B+A’B’

– Minimal SOP form: In this, the standard SOP expression is reduced up to the minimum possible expression.

Sum of Product form

A Sum of Products question can be asked in three ways:-

1) In the form Truth table
2) In the form of non-canonical Expression
3) In the form of Boolean function

Case 1: For the given table, simplify it in SOP expression

ABY
000 (m0)
010 (m1)
101 (m2)
111 (m3)

Points

  • Always consider high output (1)
  • In SOP, every term in the expression is referred to as Minterm
  • A Minterm is represented as m (small m)

How do you find the SOP expression from truth table?

Solution :
Step 1. Since there are 2 variables, so, therefore, there would be 2n combinations which are 22 =4.
We consider a high output as minterm. a minterm is denoted as m.
Y= m2+m3
Y = A.B’ +A.B                            :- It is in Canonical SOP form

In Sum of Product each term is combined with OR operation and within each term, every variable combined with AND operation.

Step 2. Now narrow the founded expression down to minimal SOP form. In this, you should know the rules of Boolean expression or K-map

Y= A.( B’ + B)
Y= A.1
Y= A

OR

Considering, A= 1, A’=0

k map 2B 2B 2Bsop

Y= A

A is your answer.

Case 2: Simplify any expression to SOP or Sum of product form, when Boolean function is given

Simplify the following Boolean function in SOP form
F(X,Y,Z) = Σm(1,4,5,6,7)

Points to Remember

  • First, check the type of m, if m is small then it would Minterm, meaning we have to solve the boolean function in respect to Sum of Product form, whereas if m is capital then it would be Maxterm, means we need to solve it in respect to Product of Sum.
  • On the left side, See how many binary variables are there, in the above case there are 3 binary variables, that’s 23 possible combinations.

How do you find the SOP expression from the boolean function?

Step 1. Make the truth table, if you want to see the actual picture or skip the step.

XYZF
0000 (m0)
0011 (m1)
0100 (m2)
0110 (m3)
1001 (m4)
1011 (m5)
1101 (m6)
1111 (m7)

In the above table, we put output as 1 or high at the mentioned position in the above Boolean function.
For example, in Boolean function  first value is 1, so we put the output high to respective place in the truth table as output 1 at  row 001  ( represents 1)
Similarly, we have 4 , so at row 100 (represents 4)  in the truth table, we put high output.

Step 2. Now make the expression as per the above table,

F= m1 + m4 + m+ m6 + m7
F=  X’Y’Z + XY’Z’ + XY’Z+ XYZ’ + XYZ                :- Canonical SOP form

Step 3. Now Solve the function to minimal SOP form using K map or Boolean rules
K-map is always considered the easiest and fastest way.

 

BOOLEAN 2BFUNCTION 2BSOP

F= X + Y’Z                   :- Minimal SOP form

This your answer

 

Case 3: Simplify any expression in SOP form, when a is given

Simplify the following expression in SOP form
F= x’z’+y’z’+yz’+xy

 OR

Simplify the following non-canonical expression in SOP form

F= x’z’+y’z’+yz’+xy

Point to remember

  • Put 1 in place of missing input and convert that 1 to the appropriate Boolean rule. Suppose in above term x’z’, y is missing ( replace 1 with (y+y’))
  • Make sure the expression is in Canonical form

How do you find the SOP expression from the non-canonical expression?

Step 1.   First, check the given expression is in Canonical form or not, if yes simply make K-map (or jump to 4th step ) and simplify it, otherwise follow the steps.

Step 2. Now, the above expression isn’t in canonical form as there are three binary variables or inputs, x , y and z which can’t be together found in each and every term. So to do this, make it canonical form by doing the following:-

F =  (x’.y’. 1) + (y’z’ .1) + (y z’ .1) + ( x. y.1 )

Since, in each term, a variable is missing, to bring it, in each term we have to put 1 to get the expression.

Step 3.  Put relevant input in place of 1 on the basis of Boolean rules

There is a rule, where

x + x’ =1 in Boolean algebra, we will apply it.

Sum of product non-canonical expression

In the first term, y is missing  (x’y’), similarly in the second one, x is missing (y’z’) and so one.

F =  x’z'( y +y’)  +  y’z'(x+x’) + yz'(x+x’)+ xy(z+z’)
F=  x’z’y+x’z’y’+y’z’x+y’z’x’+yz’x+yz’x’+xyz+xyz’

Now, Arranging in it alphabetical order for ease of understanding

F=x’yz’+x’y’z’+xy’z’+x’y’z’+xyz’+x’yz’+xyz+xyz’

It is now in Canonical SOP or Sum of Product form

Step 3. This is the last step, shrink the expression down to minimal SOP form using K-map
or Boolean algebra

sop 2Bk 2Bmap

Which gives, F = z’ + xy

 

]]>
https://programmerbay.com/sum-of-products-form/feed/ 0
Difference Between Selective Repeat And Go-Back-N Sliding Window Protocol https://programmerbay.com/difference-between-selective-repeat-and-go-back-n-sliding-window-protocol/ https://programmerbay.com/difference-between-selective-repeat-and-go-back-n-sliding-window-protocol/#respond Fri, 22 May 2020 09:26:38 +0000 https://www.programmerbay.com/?p=2629 Go-Back-N protocol and Selective-Repeat protocol are sliding window protocols used to deal with errors that is occurred during data transmission.

sliding window protocols
The main difference between them is, Go-Back-N protocol retransmits all the frames starting from the damaged or corrupted frame, whereas Selective Repeat protocol only retransmits frames that are damaged.

Difference between Selective Repeat and Go-Back- N sliding window protocol:

Go-Back-N Sliding Window Protocol Selective repeat Sliding Window protocol
It acts by retransmitting all the frames in the particular order after a damaged or corrupted frame is encounteredIt acts by retransmitting only those frames which are damaged or corrupted while transmission
It uses cumulative acknowledgements It uses independent acknowledgement
In this protocol, there is a great amount of wastage of the bandwidth, if there is a high error rate in the transmissionIn this protocol, there is less wastage as compared to Go-Back-N sliding window protocol in retransmission of frames
In this, there is absolutely no need for sorting the sender or the receiver sideIn this protocol, there is a need for the sorting of frames that too on the receiver side to maintain the proper sequence of frames
Sliding window size of receiver is 1. For sender, it is NSliding window size of receiver is N. For sender, it is same as receiver which is N
It is fairly less complicated than other protocolsIt is slightly more complicated solely because it uses strategies, logics, etc. which is not present in all protocols
The receiver does not store any frame that is received after encountering the damaged frame, till the damaged frame is retransmittedThe receiver stores the frames that are received after encountering the damaged frame in a buffer, till the damaged frame is resent by the sender
It is more frequently used as compared to Selective repeat Sliding WindowIt is less frequently used as compared to Go-Back-N

 

Selective Repeat sliding window protocol:

Selective repeat is one of the sliding window protocols which is essentially responsible for detecting and correcting the error caused in the data link layer.

The Selective repeat protocol basically only retransmits the damaged or lost frame.

The retransmitted frame in the selective repeat protocol is always received out of sequence.

 

Go-back-N sliding window protocol:

Go-back-N is also one of the sliding window protocols. This protocol mechanism is essentially used to control and detect the errors occurring in the data link layer.

During the data transmission between the sender and the receiver; if the acknowledgement is lost or the frame has been damaged then the sender has to resend all the frames starting from the damaged or corrupted frame.

]]>
https://programmerbay.com/difference-between-selective-repeat-and-go-back-n-sliding-window-protocol/feed/ 0
Difference between user mode and kernel mode https://programmerbay.com/difference-between-kernel-and-user-mode/ https://programmerbay.com/difference-between-kernel-and-user-mode/#respond Mon, 01 Apr 2019 16:41:42 +0000 https://www.programmerbay.com/?p=2641 An operating system can have various modes of operation and these modes define standardised instructions for deciding what resources can be accessed, limit memory access and more in order to protect data and provide system security.

There are two types of modes, User Mode and Kernel Mode. A kernel mode is also known as supervisor mode.

kernel mode and user mode

User mode

It has restricted access to the resources. CPU has restrictions, therefore, it can have only access to limited instructions and memory. Utility applications such as text editor, media player are run in this mode.

When an application or program is executed, its initial state and operation mode are loaded on stack. At this point, CPU starts executing the program in this particular mode. Interrupts and traps are used to signal  or flag the CPU to switch back to Kernel mode and do the essential tasks by storing the current state of the user program to the stack again. After completing it, CPU resumes the program from where it left.

Kernel Mode

It has full access to memory, I/O and other resources. In this, CPU can execute any instructions and have full access to underlying hardware. The core functionalities of the operating system always run in Kernel mode.

Having these authorities, processes using this mode have full rights to access resources, allowing them read/write to the storage media, enable and disable hardware and more. Difference between Kernel Mode and User Mode :

BasisKernel ModeUser Mode
PermissionUnrestricted and full permissions to access the system's hardwareRestricted and limited permissions to access the system's hardware
Memory referenceIt can reference to both the memory spacesIt can only reference to memory space that is dedicated to user mode
AccessOnly core functionality can be allowed to operate in this very modeUser applications can access this mode for a particular system and is allowed to operate in this particular mode
System crashFatal and increases the complexityRecoverable and can simply restart the session
Also Known Privileged mode or Supervisor mode Restricted mode

Key Differences:

  1. The mode in which there is an unconditional, unrestricted and full permission to access the system’s hardware by the current executing piece of code is known as the kernel mode. The mode in which there is no means of accessing the system’s hardware directly by the current piece of code is also known as the user mode.
  2. The kernel mode is a very powerful and impactful mode which means that it can refer to any memory block of the system and can also orders to execute an instruction to the CPU. The user mode is standardized and normal viewing mode which means that it cannot reference to any memory block or execute any information on its own as it requires some Application Protocol Interface (API) to do these tasks.
  1. The kernel mode is the most unrestricted and candid mode that a system can have which means that only the trustable sources can be allowed to operate in this very mode. The user mode is more like a generic mode that can have, which means that any user can access this mode for a particular system and is allowed to operate in this particular mode.
  1. As the kernel mode is very important and candid this means that if the system crashes in this mode then it could be very fatal and increases the complexity. As the user mode is quite general and user-friendly this means that even if the system crashes in this mode then it is not fatal at all and can simply restart the session.
  1. The kernel mode is very crucial to the system as well as the system programmer so everything that runs easily runs on your PC might not run here because its purpose is to employ hardware for a particular task. The user mode is user friendly space where all the general code will definitely execute.

]]>
https://programmerbay.com/difference-between-kernel-and-user-mode/feed/ 0
Boolean Algebra : Simplify the following expressions using Boolean Algebra https://programmerbay.com/boolean-algebra-simplify-the-following-expressions-using-boolean-algebra/ https://programmerbay.com/boolean-algebra-simplify-the-following-expressions-using-boolean-algebra/#respond Sun, 06 May 2018 16:36:00 +0000 http://programmerbay.com/?p=3102

Simplify the following expressions using Boolean Algebra :-

 

  •  A + AB

= A.1+AB
= A(1+B)                            :-  OR (A+1 = 1)
= A.1
= A

 

  • AB+AB’

= A(B+B’)                            :- AB+AC = A(B+C)
= A(B+B’)                           :-  A + A’ =1
= A(1)
= A

  • A’BC + AC

= C(A’B+A)                         :- A+BC =  (A+B).(A+C)
= C((A’+A).(A+B))             :- A’+A=1
= C(1.(A+B))
= C(A+B)

 

  • A’B+ABC’+ABC

= A’B+AB(C’+C)                       :- A’+A=1
= A’B+AB
= B(A’+A)                                   :- A’+A=1
= B

  • A’ B’ C + A’ B C’ + A B’ C’ + A B C

 

= A’(B’C+BC’)+A(B’C’+BC)            :-  A’B+AB’ = A XOR B     , A’B+AB’ = (A XOR B)’
=A’(B XOR C) + A((B XOR C)’)      :-    let B XOR C = T ,   A’T+AT’ which implies  =A XOR T
= A XOR T                                                :-  T = B XOR C

 

=A XOR B  XOR C
 
Note: It is illustrated for beginners

]]>
https://programmerbay.com/boolean-algebra-simplify-the-following-expressions-using-boolean-algebra/feed/ 0