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
|