+ All Categories
Home > Documents > Encoder decoder

Encoder decoder

Date post: 25-May-2015
Category:
Upload: dennis-gookyi
View: 850 times
Download: 9 times
Share this document with a friend
Popular Tags:
14
Hanbat Hanbat National National University University Encoder-Decoder in Encoder-Decoder in Verilog Verilog Gookyi Dennis A. N. Gookyi Dennis A. N. SoC Design Lab. SoC Design Lab. July.15.2014
Transcript
Page 1: Encoder decoder

HanbatHanbat

NationalNational

UniversityUniversityHanbatHanbat

NationalNational

UniversityUniversity

Encoder-Decoder in Encoder-Decoder in Verilog Verilog

Encoder-Decoder in Encoder-Decoder in Verilog Verilog

Gookyi Dennis A. N. Gookyi Dennis A. N.

SoC Design Lab.SoC Design Lab.

July.15.2014

Page 2: Encoder decoder

ContentsContents Objectives Encoder Decoder Encoder-Decoder

2

Page 3: Encoder decoder

Objectives Objectives Wish to design a system that encodes at one end and

decode at the other end Design a 4 to 2 encoder Design a 2 to 4 decoder Design a top level module that instantiates the

encoder and the decoder

3

Page 4: Encoder decoder

Block diagramBlock diagram The block diagram of the whole system is shown

below:

4

4 to 2Encoder

2 to 4 Decoder

4 Bit input

4 Bit output2 Bit inout

Page 5: Encoder decoder

Encoder Encoder Truth table of 4 to 2 encoder is shown below:

Output equations are as follows:out[0] = ((~in[3])&(~in[2])&(in[1])&(~in[0])) | out[0] = ((~in[3])&(~in[2])&(in[1])&(~in[0])) |

(((in[3])&(~in[2])&(~in[1])&(~in[0])))(((in[3])&(~in[2])&(~in[1])&(~in[0])))

out[1] = ((~in[3])&(in[2])&(~in[1])&(~in[0])) | out[1] = ((~in[3])&(in[2])&(~in[1])&(~in[0])) | (((in[3])&(~in[2])&(~in[1])&(~in[0])))(((in[3])&(~in[2])&(~in[1])&(~in[0])))

5

In[3] In[2] In[1] In[0] Out[1]

Out[0]

0 0 0 1 0 0

0 0 1 0 0 1

0 1 0 0 1 0

1 0 0 0 1 1

Page 6: Encoder decoder

EncoderEncoder Verilog code for encoder (submodule)

6

Page 7: Encoder decoder

EncoderEncoder RTL schematic

7

Page 8: Encoder decoder

Decoder Decoder Truth table for 2 to 4 decoder

Output equations are as follows:out[0] = (~in[0]) & (~in[1])out[1] = (in[0]) & (~in[1])out[2] = (~in[0]) & (in[1])out[3] = (in[0]) & (in[1])

8

In[1] In[0] Out[3]

Out[2]

Out[1]

Out[0]

0 0 0 0 0 1

0 1 0 0 1 0

1 0 0 1 0 0

1 0 1 0 0 0

Page 9: Encoder decoder

Decoder Decoder Verilog code for decoder (submodule)

9

Page 10: Encoder decoder

DecoderDecoder RTL schematic

10

Page 11: Encoder decoder

Encoder_DecoderEncoder_Decoder Verilog code

11

Page 12: Encoder decoder

Encoder_DecoderEncoder_Decoder RTL schematic

12

Page 13: Encoder decoder

Encoder_DecoderEncoder_Decoder Full testbench

13

Page 14: Encoder decoder

Encoder_DecoderEncoder_Decoder Waveform

14


Recommended