Author Topic: input [7:0] data; in verilog. Serial or parallel?  (Read 1047 times)

0 Members and 1 Guest are viewing this topic.

Offline DmeadsTopic starter

  • Regular Contributor
  • *
  • Posts: 158
  • Country: us
  • who needs deep learning when you have 555 timers
input [7:0] data; in verilog. Serial or parallel?
« on: July 26, 2019, 07:15:16 am »
Hello!

im messing around in verilog, and i have an 8 bit input data variable of type wire.

does this mean that the data will come into the module one bit at a time? or do all the bits come in parallel and the one wire acts as 8?

thanks!
 

Offline hamster_nz

  • Super Contributor
  • ***
  • Posts: 2803
  • Country: nz
Re: input [7:0] data; in verilog. Serial or parallel?
« Reply #1 on: July 26, 2019, 07:32:29 am »
8 bits in parallel.
Gaze not into the abyss, lest you become recognized as an abyss domain expert, and they expect you keep gazing into the damn thing.
 
The following users thanked this post: Dmeads

Offline mrflibble

  • Super Contributor
  • ***
  • Posts: 2051
  • Country: nl
Re: input [7:0] data; in verilog. Serial or parallel?
« Reply #2 on: July 26, 2019, 08:15:46 am »
This one might be useful for a quick lookup of verilog related questions:
http://www.asic-world.com/verilog/veritut.html
 
The following users thanked this post: Dmeads

Offline SethGI

  • Regular Contributor
  • *
  • Posts: 51
  • Country: us
Re: input [7:0] data; in verilog. Serial or parallel?
« Reply #3 on: August 11, 2019, 03:24:35 pm »
In verilog, when you use the [n:m] syntax, you're specifying a bus. That means, as others have answered, it'll come in in parallel. So 8 wires.

The most important thing everyone needs to know about verilog is it is NOT a programming language (at least how you'd typically think about it). You're not specifying what the FPGA should *do*, you're specifying how to connect the hardware. Even things like case switches which feel more like imperative programming are really just convenient ways to specify the hardware connections. In that context, it wouldn't make much sense for the 8 bits to somehow serialize themselves, you'd have to specify the hardware for that. Go ahead and look at the visualization tools in your compiler each time you compile to understand the hardware you're implying. I think the biggest thing which causes people issues in FPGA programming is they think "what are the steps I need to take to get the desired behavior" and try to program in those steps, whereas  the correct question is "what hardware do I need for the desired behavior". Sorry for the tangential rant you likely already (kinda) understood, but this is really important to keep in mind when learning verilog.
 
The following users thanked this post: Dmeads


Share me

Digg  Facebook  SlashDot  Delicious  Technorati  Twitter  Google  Yahoo
Smf