Continue to Site

Welcome to EDAboard.com

Welcome to our site! EDAboard.com is an international Electronics Discussion Forum focused on EDA software, circuits, schematics, books, theory, papers, asic, pld, 8051, DSP, Network, RF, Analog Design, PCB, Service Manuals... and a whole lot more! To participate you need to register. Registration is free. Click here to register now.

how to make 8 bit in verilog

Status
Not open for further replies.

vead

Full Member level 5
Joined
Nov 27, 2011
Messages
285
Helped
3
Reputation
6
Reaction score
3
Trophy points
1,298
Location
india
Activity points
3,815
hello embers
I want to make port for microcontroller in verilog code
I want to write verilog code for 8 bit port

module port (data_in,data_out )
input[7:0] data_in;
output[7:0]data_out;
wire [7:0]data_out;
endmodule

I think its not enough tell me what I do to make port in verilog I did google but I did not get success
 

hi,
what is the relation between output and input?
you just define the relation in the code ,that is enough
 

As I haven't run across any microcontrollers with a separate input and output data interface bus (parallel peripheral interfaces are usually bi-directional) I've taken the liberty of showing you a bi-directional interface.

At a minimum, with only 1 register in the FPGA would be something like:

Code Verilog - [expand]
1
2
3
4
5
6
7
8
module port (
  inout   [7:0]   data_io,
  input           r__w_n,
  input           enb_n,
  input           clk
);
// rest of code...
endmodule



with multiple registers that need to be accessed you'll also need an address bus:

Code Verilog - [expand]
1
2
3
4
5
6
7
8
9
module port (
  inout   [7:0]   data_io,
  input   [15:0]  addr,
  input           r__w_n,
  input           enb_n,
  input           clk
);
// rest of code...
endmodule



Note the different syntax for Verilog 2001 port declarations. You should really switch, it's been 13 years since it was introduced and it seems universities (like those in India) seem to be stuck in the HDL stone age.

Regards
 

Status
Not open for further replies.

Part and Inventory Search

Welcome to EDABoard.com

Sponsor

Back
Top