GithubHelp home page GithubHelp logo

santhanalakshmi04 / experiment-08-encoders-and-decoders- Goto Github PK

View Code? Open in Web Editor NEW

This project forked from vasanthkumarch/experiment-08-encoders-and-decoders-

0.0 0.0 0.0 8 KB

License: BSD 3-Clause "New" or "Revised" License

experiment-08-encoders-and-decoders-'s Introduction

Experiment-08- Encoders-and-decoders

AIM: To implement 8 to 3 Encoder and 3to8 Decoder using verilog and validate its outputs

HARDWARE REQUIRED: – PC, Cyclone II , USB flasher

SOFTWARE REQUIRED: Quartus prime

THEORY

Encoders

Binary code of N digits can be used to store 2N distinct elements of coded information. This is what encoders and decoders are used for. Encoders convert 2N lines of input into a code of N bits and Decoders decode the N bits into 2N lines.

  1. Encoders – An encoder is a combinational circuit that converts binary information in the form of a 2N input lines into N output lines, which represent N bit code for the input. For simple encoders, it is assumed that only one input line is active at a time.

As an example, let’s consider Octal to Binary encoder. As shown in the following figure, an octal-to-binary encoder takes 8 input lines and generates 3 output lines.

image

Figure -01 3 to 8 Encoder

Implementation –

X = D4 + D5 + D6 + D7 Y = D2 +D3 + D6 + D7 Z = D1 + D3 + D5 + D7 Hence, the encoder can be realised with OR gates as follows:

image

Figure -02 3 to 8 Encoder implenentation

Decoders

A decoder does the opposite job of an encoder. It is a combinational circuit that converts n lines of input into 2n lines of output.

Let’s take an example of 3-to-8 line decoder. Implementation – D0 is high when X = 0, Y = 0 and Z = 0. Hence,

D0 = X’ Y’ Z’ Similarly,

D1 = X’ Y’ Z D2 = X’ Y Z’ D3 = X’ Y Z D4 = X Y’ Z’ D5 = X Y’ Z D6 = X Y Z’ D7 = X Y Z

image

Figure -03 8 to 3 Decoder

image

Figure -04 8 to 3 Decoder implementation

Procedure

Step 1: Open Quartus II and select new project and choose the file location.

Step 2: Module Declaration. Module should have the file name.

Step 3: Input-Output Delecaration.

Step 4: Use assign to define the functionality of logic circuits.

Step 5: At the end give endmodule.

Step 6: Run the program and choose RTL viewer to get RTL realization.

Program for Endocers and Decoders and verify its truth table in quartus using Verilog programming

PROGRAM

/* Program for Endocers and Decoders and verify its truth table in quartus using Verilog programming. Developed by: santhana lakshmi.k RegisterNumber: 22003398 */ For Encoder:

module encode(a,b,c,d0,d1,d2,d3,d4,d5,d6,d7);

output a,b,c;

input d0,d1,d2,d3,d4,d5,d6,d7;

or(a,d4,d5,d6,d7);

or(b,d2,d3,d6,d7);

or(c,d1,d3,d5,d7);

endmodule

For Decoder:

module decode(d0,d1,d2,d3,d4,d5,d6,d7,a,b,c);

output d0,d1,d2,d3,d4,d5,d6,d7;

input a,b,c;

assign d0 = (~a&~b&~c);

assign d1 = (~a&~b&c);

assign d2 = (~a&b&~c);

assign d3 = (~a&b&c);

assign d4 = (a&~b&~c);

assign d5 = (a&~b&c);

assign d6 = (a&b&~c);

assign d7 = (a&b&c);

endmodule

RTL LOGIC

ENCODER

214379229-9fcd4af0-2e57-4cd3-88de-b8907bdd8e84

DECODER

214379328-899a292c-4b95-4f97-9b07-5ceed9bb84b0

TIMING DIGRAMS

ENCODER

214379455-7fd6c6a2-239b-474c-901e-693ff63f103f

DECODER

214379903-a226e5e4-9a0c-4ae3-8ce4-41b0821a12f1

TRUTH TABLE

Encoder

214380081-ae919d79-eb91-41a4-a184-1df8ec42b0a7

DECODER

214380148-9b05957c-9395-4776-b4b8-e518d61c41eb

RESULTS

8 to 3 Encoder and 3to8 Decoder has been implemented by using verilog and its outputs are validated

experiment-08-encoders-and-decoders-'s People

Contributors

santhanalakshmi04 avatar vasanthkumarch avatar

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.