verilog examples

verilog examples - Design Examples Design Examples 8_to_3...

Info iconThis preview shows pages 1–4. Sign up to view the full content.

View Full Document Right Arrow Icon
Design Examples Design Examples Dept. of CSIE, DYU 2 Design Examples ± 8_to_3 Encoder ± 3_to_8 Decoder ± 16-bit Accumulator ± 8-bit MAC ± Bi-directional ports ± 16-bit register ± Frequency Divider by N
Background image of page 1

Info iconThis preview has intentionally blurred sections. Sign up to view the full version.

View Full DocumentRight Arrow Icon
Design Examples Dept. of CSIE, DYU 3 Ex1: 8_to_3 Encoder 8-to-3 priority encoder out[2] Truth table in[7] in[6] in[5] in[4] in[3] in[2] in[1] in[0] out[1] out[0] none_ON Design Examples Dept. of CSIE, DYU 4 Ex1: Priority Encoder // Encoder1.V: (Priority Encoder), 1 // Highest Bit 1 module Encoder1 (In, Out, None_ON); input [7:0] In; output [2:0] Out; output None_ON; reg [2:0] Out; reg None_ON; . . . endmodule always @(In) begin: Encoder_Block integer i; Out = 0; None_ON = 1; for (i = 0; i < 8; i = i+1) begin // Highest Bit 1 if (In[i]) begin Out = i; None_ON = 0; end end end
Background image of page 2
Design Examples Dept. of CSIE, DYU 5 Ex2: 3_to_8 Decoder 3-to-8 decoder A[2] A[1] A[0] G D[7] D[6] D[5] D[4] D[3] D[2] D[1] D[0] Truth table Design Examples Dept. of CSIE, DYU 6 // Dec_3to8.V 3 8 module Decoder_3to8 (A2, A1, A0, G, D7, D6, D5, D4, D3,
Background image of page 3

Info iconThis preview has intentionally blurred sections. Sign up to view the full version.

View Full DocumentRight Arrow Icon
Image of page 4
This is the end of the preview. Sign up to access the rest of the document.

Page1 / 9

verilog examples - Design Examples Design Examples 8_to_3...

This preview shows document pages 1 - 4. Sign up to view the full document.

View Full Document Right Arrow Icon
Ask a homework question - tutors are online