script async='async' crossorigin='anonymous' src='https://pagead2.googlesyndication.com/pagead/js/adsbygoogle.js?client=ca-pub-6016566166623052'/> Verilog coding: Decoder
Showing posts with label Decoder. Show all posts
Showing posts with label Decoder. Show all posts

Wednesday, 17 March 2021

3- to-8 line Decoder full Block Diagram, Truth Table, and Logic Diagram

 What is  a Decoder:

         A decoder is used to convert binary into decimal. Decoder is a combinational logic circuit that has n input lines and a maximum of 2n unique output lines.

fpga verilog code example

3-to-8 Line Decoder:

               A 3x8 lines decoder has three inputs  i.e A,B,C and eight outputs i.e D0 ,D1,D2,D3,D4,D5,D6 and  D7. which are generated by using inputs i.e 2^3.

Block Diagram of 3X8 Decoder:



fig1. Block Diagram of 3X8 Decoder

Truth Table of 3X8 decoder:


fig2.Truth Table of 3X8 decoder


D0 = A’B’C’

D1= A’B’C

D2 = A’BC’

D3 = A’BC

D4 = AB’C’

D5= AB’C

D6 = ABC’

D7 = ABC


Logic Diagram of 3X8 Decoder:

fig3. Logic Diagram of 3X8 Decoder


Friday, 14 April 2017

Verilog code for 2-to-4 line Decoder:

How to program 2-to-4 line Decoder in verilog?
A Decoder is a simple logic gates diagram that changes a code into a set of different signals. Decoder is the reverse process of Encoders.
A simple/common  decoder is the line decoder which takes an n-digit binary number and decodes it into 2n data lines. The simplest decoder is the 1-to-2 line decoder. Following is the truth table of 1-to-2 line decoder,

Following is the truth table of 2-to-4 line decoder ;


when it developed into a logic circuit it looks like





Verilog code of 2 to 4 line decoder:

module decoder(d,A0,A1);
output [3:0] d;
input x,y;
assign d[0] = ~A0 & ~A1 ;
assign d[1] = A0 & ~A1;
assign d[2] = ~A0 & A1;
assign d[3] = A0 & A1 ;
endmodule





fpga verilog code example