1
0
mirror of https://github.com/myhdl/myhdl.git synced 2025-01-24 21:52:56 +08:00
myhdl/example/manual/bin2gray.v

27 lines
300 B
Coq
Raw Normal View History

2008-11-22 22:40:25 +01:00
// File: bin2gray.v
2016-05-23 15:56:00 +02:00
// Generated by MyHDL 1.0dev
// Date: Mon May 23 16:09:27 2016
2010-07-02 13:24:04 +02:00
2008-11-22 22:40:25 +01:00
`timescale 1ns/10ps
module bin2gray (
B,
G
);
2010-07-02 13:24:04 +02:00
// Gray encoder.
//
2016-05-23 15:56:00 +02:00
// B -- binary input
// G -- Gray encoded output
2008-11-22 22:40:25 +01:00
input [7:0] B;
output [7:0] G;
2016-05-23 15:56:00 +02:00
wire [7:0] G;
2008-11-22 22:40:25 +01:00
2016-05-23 15:56:00 +02:00
assign G = ((B >>> 1) ^ B);
2008-11-22 22:40:25 +01:00
endmodule