Electronics > Beginners
modern TTL/Logic-gate/74xx
<< < (6/13) > >>
ker2x:

--- Quote from: rstofer on October 08, 2019, 04:08:41 pm ---
--- Quote from: ker2x on October 08, 2019, 06:41:40 am ---And how am i supposed to fail in electronic if all i have to do is to buy an FPGA dev board and write code ?

--- End quote ---

Eventually the programmers come to realize that every single line of code in a 10,000 line project is executing in parallel.  Signals 3 levels deeper are still changing state, massive things are happening on each clock pulse.  Just handing data off from one module to another has timing implications if the processes are clocked (one clock delay is typical, sometimes 2 if crossing a clock domain).  It is up to the designer to keep track of the timing of every signal in the design.  In bits and pieces, true, but everything is happening in parallel.

There is nothing in the world of procedural code that comes anywhere near to being as massively parallel as writing in an HDL.  What ?  A CPU has 4 cores and 2 threads per core?  8 things going on at a time?  That's trivial!  In HDL I can have thousands of independent processes all running in parallel, happily moving information from place to place.  Got FreeRTOS running?  Great!  But it's still just serializing.

--- End quote ---

I'm aware, that's what got me interested in FPGA in the past, years ago, until i realized it wasn't fun at all  ;D
I'm a big fan of developing using pipelines, with one threads per pipeline. But still, it's much different than coding FPGA for sure.
The learning curve of fpga remind me of this meme :
https://aws1.discourse-cdn.com/eveonline/original/2X/9/9a395dad41a3cccfecd1346e6bc4aa48beb14442.jpg
rstofer:
Of course I like hardware, that was my major in grad school back in '75..'76, when the 8080 was king.

One of the problems I have with learning new skills is that unless I have a project with an end goal, I won't stick with it.  I have tried several video series on C++ and Python and I get into it for a short while but burn out quickly.  The reason is two-fold:  First, I don't have an immediate need for the skill and, more important, the tutorials tell me what to do and how to do it but they don't tell me why I would want to do it.  Just because everything is an object, why should I code THIS project using THAT process when I can just do it in C or Fortran?

I would imagine that learning an HDL would be the same kind of thing.  Unless there is an immediate goal and adequate tutorials, why bother?  Frankly, it would be boring.

How about one last experiment before trashing HDLs forever?  Use Vivado to create a 74181 (and, for extra credit, a 74182 carry generator).  That's all.  Keep it simple, just 4 bits wide.  Now run the simulator (which I have never used) and see if it will do all the operations required.  I have no idea how to create the test bench that provides inputs to the device but from what I have seen, it doesn't look hard.  Somebody around here can help with that.

Since this is just combinatorial logic, I would just use toggle switches for the inputs and LEDs for the output.

I could choose to write the code using the logic diagrams on the Internet or just use a CASE statement.  Likely I would use a CASE statement based on the M input and under each branch, I would have a CASE statement for each of the 16 functions.  I might break up the Arithmetic CASE statement into two further CASEs based on the Carry input.  That would make the function quite clear.

http://www.righto.com/2017/03/inside-vintage-74181-alu-chip-how-it.html

Here's a defined goal - get an ALU to work!  Once done, this is the most logically complex part of a CPU and it works!
schratterulrich:
Hello ker2x,
if you decide to build your project with discrete logic, you should really think carefully about which logic family you are using.
We have used LVC logic in the past to buffer a parallel RGB display interface for example. It was a typical case for unnecessarily fast logic with all the drawbacks. We used  series termination resistors on all nets and of course impedance defined traces. But as we had to route the bus thru a ribbon cable we caught some EMC radiation problems.
Finally we had to redesign the board due to EMC issues.
We then investigated different logic families and decided to use the 74AUP family. We could eliminate the series termination resistors and got very clean signal edges. Also the EMC radiation problem was gone.

some advantages of AUP
much shorter propagation delay than 74HC
low power consumption
"very good signal integrity"; relativ slow transition rate; ouput impedance near to 50 Ohm

some disadvantages of AUP
only in single/dual gate packages
supply voltage < 3.6 V

on the other side
Problems with too fast logic:
- signal reflections if not properly terminated
 see http://www.ti.com/lit/an/sdya010/sdya010.pdf for some information on unterminated signal waveforms of older logic families.
- GND-Bounce / VCC sag
 see http://www.ti.com/lit/an/szza038b/szza038b.pdf
- higher requirements for decoupling / power distribution

in short don't use LVC if not absolutely required for propagation delay
 

 


james_s:

--- Quote from: rstofer on October 08, 2019, 04:08:41 pm ---It is common for programmers of procedural code to look at Verilog and VHDL as just another language.  It is, and it isn't.  Yes, they are both languages but...  They're describing hardware, massively parallel hardware!

Eventually the programmers come to realize that every single line of code in a 10,000 line project is executing in parallel.  Signals 3 levels deeper are still changing state, massive things are happening on each clock pulse.  Just handing data off from one module to another has timing implications if the processes are clocked (one clock delay is typical, sometimes 2 if crossing a clock domain).  It is up to the designer to keep track of the timing of every signal in the design.  In bits and pieces, true, but everything is happening in parallel.

--- End quote ---


I don't even like to think of HDL as anything "executing" because it's really not. HDL is not a program, the instructions aren't executing, they're describing hardware using a language that superficially resembles a program.

If you have a line like:

A  <= B AND C;

That's not an instruction to execute an operation on variables, it's an instruction that says "wire signals B and C to the inputs of a two-input AND gate and connect the output to signal A". Once this gate has been "wired up" it will do its thing, it doesn't have to wait for an instruction to execute in a loop, the instruction described how to wire up the hardware.

Existing programming experience can be more hindrance than help when learning HDL because it's so hard to get out of that mentality of writing a program and start viewing it as describing hardware.
ledtester:
If you don't want to learn a VHDL-like language, may I suggest:

https://clash-lang.org/

There's even a tutorial on how to go about building a CPU with it:

https://yager.io/CPU/CPU1.html
Navigation
Message Index
Next page
Previous page
There was an error while thanking
Thanking...

Go to full version
Powered by SMFPacks Advanced Attachments Uploader Mod