Hacker Newsnew | comments | show | ask | jobs | submit login

As a hardware guy, I'm kind of fascinated by how many stories I've seen on HN recently on HDLs, and equally fascinated by how software people describe their mental model and thought processes when thinking about hardware design. It's neat to see how the structure of the problem space is fundamentally different, I think, to how a hardware guy sees it - which is not to say any less valid, and quite possibly becoming more valid.

But I also think that to do hardware design in VHDL or Verilog, you need to understand the underlying structures - latches, flip-flops, decoders, muxes, etc.

I'm enjoying this recent trend!




As an old-school software gal, it's amazing to me how software engineers these days think, too. The sentence "ever wondered why integers in software are powers of two?" made a very powerful point for me - namely, how far software engineering these days is removed from the underlying implementation.

Mind, I don't fault the author for being surprised. It's a logical consequence of that remove. But as somebody who grew up with blinkenlights and core memory, the idea of not knowing this fact is completely foreign to me, even though I have no HW skills worth mentioning.

Part of me wonders if that means we should teach SW engs about those realities. Especially given the authors wide-eyed realization that all that code executes in parallel, all the time. It's a mental model that seems rather useful given the amount of parallelism we see and will be seeing.

Or maybe I'm just old and grumpy ;)

-----


I'm the author. First, I'd like to point out that I started out as a programmer for embedded devices.. so I did know about the parallel nature and powers of two. BUT, I do know lots of programmers who don't. My intention was to teach those who know nothing of computer hardware and are asking these questions. Hopefully you'll be less grumpy now. (:

-----


Oh, my grumpyness is unrelated to the article :)

As I said, I don't see not knowing this as a fault - it's a product of our current environment and the fact that the gulf between HW and SW has widened. As such, it's not making me grumpy. I just thought it made an interesting point about how much we've progressed.

And good on you for pointing it out and teaching about it!

-----


I don't think you're old and grumpy; I graduated in 2011, and was just as shocked as you.

-----


But I also think that to do hardware design in VHDL or Verilog, you need to understand the underlying structures - latches, flip-flops, decoders, muxes, etc.

Only barely. Modern FPGAs are made up of LUTs and flip-flops, which can be abstracted as "cloud of programmable asynchronous logic surrounded by D Flip-Flops". I think if you start by explaining the abstract notion of asynchronous logic, and the notion of gating a design using D flip-flops, you can get someone up the HDL learning curve really fast without going into the depths of what boolean functions are, what a mux is, etc. Boolean functions and muxes aren't a central component of modern programmable logic anyway.

I've been thinking about writing up "30 minutes to your first HDL design" at some point. Dragging a competent C programmer up the learning curve is pretty easy, as long as you don't start off with "it's like C but...". I've trained a few SE interns to write some halfway-decent CPLD designs in just an hour or two, and consequently I think that the way they've taught it at school is way too low-level for someone that's going to be working with modern programmable logic, and it needn't be so painful.

-----


Given your experience, how good is this: http://www.xess.com/appnotes/FpgasNowWhatBook.pdf

-----


Would love to see such a tutorial. Not that I have any use for it but it would be interesting to know.

-----


  entity and_entity is
    port( 
      x, y: in std_logic;
      result: out std_logic
    );
  end and_entity;
 

It took a couple of minutes of staring to realize that it was a way of representing the concept of just splicing 2 wires into a 3rd.

To me, it's making an always-on connection, such that any electricity on either line "x" or "y" will induce an identical electrical current on "result". This would obviously include any electrical signals, including HIGH/LOW pulses. And they're combined, so HIGH on either "x" or "y" outputs HIGH on "result".

Because of how I read code, I see that as: whatever is in buckets "x" and "y" are combined and copied into bucket "result".

I've never thought of lines, buses, leads, wires, etc as buckets. Yet that's how I think they're described in this code. But if you think about an individual clock cycle frozen in time, some wires have HIGH pulses, and the intention is to copy the HIGH pulse from that wire/bucket.

-----


That code fragment is really just the pin-out of a block - or to a software person, it's basically a functional interface. Naming aside, it could be the pinout of a number of number things - it could an and gate like this, or one of the signals could be a clock and this is a register... or an entire delay line.

A really interesting mental-model barrier to watch hardware newbs overcome is to present them with designing a counter - and watching as the very first thing they want to type is a for loop, which is generally not how you'd do it, but almost reflexive to someone who has been programming for a while - particularly in an imperative style.

-----




Guidelines | FAQ | Support | API | Security | Lists | Bookmarklet | DMCA | Apply to YC | Contact

Search: