1
0
mirror of https://github.com/myhdl/myhdl.git synced 2024-12-14 07:44:38 +08:00
myhdl/example/manual/bin2gray.v
2016-05-23 16:11:01 +02:00

27 lines
300 B
Verilog

// File: bin2gray.v
// Generated by MyHDL 1.0dev
// Date: Mon May 23 16:09:27 2016
`timescale 1ns/10ps
module bin2gray (
B,
G
);
// Gray encoder.
//
// B -- binary input
// G -- Gray encoded output
input [7:0] B;
output [7:0] G;
wire [7:0] G;
assign G = ((B >>> 1) ^ B);
endmodule