...

3-8デコーダ

by user

on
Category: Documents
10

views

Report

Comments

Transcript

3-8デコーダ
3-8デコーダ
3入力8出力のデコーダで
入力された数字に対応する出力が1になる。
同様にn入力2のn乗出力のデコーダも構成可能
0
1
0
A2
A1
Ao
Yo
Y1
Y2
Y3
Y4
Y5
Y6
Y7
1
3-8デコーダの記述例
module dec38 (
input [2:0] a,
output [7:0] y);
assign y = a==3’b000 ? 8’b00000001:
a==3’b001 ? 8’b00000010:
a==3’b010 ? 8’b00000100:
a==3’b011 ? 8’b00001000:
a==3’b100 ? 8’b00010000:
a==3’b101 ? 8’b00100000:
a==3’b110 ? 8’b01000000: 8’b10000000;
endmodule
assign y = 1<<a; などという書き方もある。
Fly UP