Re: [myhdl-list] essay about integer arithmetic
Brought to you by:
jandecaluwe
From: Jan D. <ja...@ja...> - 2009-03-06 16:02:52
|
Michael Baxter wrote: > Yes, but I intend for integers to represent fields of bits, and to do numerous > other things that are not constrained by intervals. In fact, some of those > things (involving plural, concurrent bitfields) can be done purely with > conventional arithmetic operations. Normal integers, but not being used normally. > > A 32-bit microprocessor (comprised of hardware) can have 32-bit registers that > represent integers that are not signed, or that are signed, both at the same > time. It all depends on what software does to interpret the meaning of those > 32-bit register bits. What's the correct interval representation for the > design of the registers in that hardware? There is none. You use a bit vector in this case, design at the bit level, and let the integer interpretation to software: a = intbv(0)[32:] I hope it's clear from the essay that intbv is dual-mode type, where you have the *option* to use it as a true integer if you want. I realize that you suggest that such use cases don't exist. That sounds absurd to me, but of course I've not only used Verilog but also VHDL :-) Jan -- Jan Decaluwe - Resources bvba - http://www.jandecaluwe.com Python as a hardware description language: http://www.myhdl.org |