Verilog HDL question

Guest
Dear all,

Please advise me the guide for the following question. In fact, I
haven't learn it yet!

(b) Write a continuous assignment to model the following operation
without using the '*' or '/' operators:

Y = 5M + 0.5N + 0.25Q;

Thanks a lot!
 
bckcookie@hotmail.com wrote:

Please advise me the guide for the following question. In fact, I
haven't learn it yet!

(b) Write a continuous assignment to model the following operation
without using the '*' or '/' operators:

Y = 5M + 0.5N + 0.25Q;
Without knowing the form of Y, M, N, and Q it is
a little hard to say.

-- glen
 
On 3$B7n(B22$BF|(B, $B2<8a(B3$B;~(B20$BJ,(B, glen herrmannsfeldt <g...@ugcs.caltech.edu> wrote:
bckcoo...@hotmail.com wrote:
Please advise me the guide for the following question. In fact, I
haven't learn it yet!
(b) Write a continuous assignment to model the following operation
without using the '*' or '/' operators:
Y = 5M + 0.5N + 0.25Q;

Without knowing the form of Y, M, N, and Q it is
a little hard to say.

-- glen
Can we assume them to a variable value. I just want how to write with
continuous assignment! Thanks a lot!
 
bckcookie@hotmail.com wrote:

Can we assume them to a variable value. I just want
how to write with continuous assignment! Thanks a lot!
Well, verilog is a hardware description language.
There are no variables in the sense that there are in C.

there are wires and regs.

So, imagine someone gives you the ends of some wires,
though you can't see where the other ends are.

The wires have little letters written on them such as
Y and Q, and asks you the original question that you
asked here. Maybe you also have a 5 volt power supply
and a drawer full of TTL ICs. Now what do you do?

-- glen
 
On Mar 22, 3:18 am, bckcoo...@hotmail.com wrote:
On 3$B7n(B22$BF|(B, $B2<8a(B3$B;~(B20$BJ,(B, glen herrmannsfeldt <g...@ugcs.caltech.edu> wrote:

bckcoo...@hotmail.com wrote:
Please advise me the guide for the following question. In fact, I
haven't learn it yet!
(b) Write a continuous assignment to model the following operation
without using the '*' or '/' operators:
Y = 5M + 0.5N + 0.25Q;

Without knowing the form of Y, M, N, and Q it is
a little hard to say.

-- glen

Can we assume them to a variable value. I just want how to write with
continuous assignment! Thanks a lot!
Assuming 32-bit M,N,Q:

module calculator(
input [31:0] M,
input [31:0] N,
input [31:0] Q,
output [31:0] Y
)

assign Y = (M << 2) + M + (N >> 1) + (Q >> 2);
endmodule
 
Poojan Wagh wrote:

assign Y = (M << 2) + M + (N >> 1) + (Q >> 2);
You going with him to his job interviews as well?

--
Mark McDougall, Engineer
Virtual Logic Pty Ltd, <http://www.vl.com.au>
21-25 King St, Rockdale, 2216
Ph: +612-9599-3255 Fax: +612-9599-3266
 
Mark McDougall wrote:
You going with him to his job interviews as well?
Perhaps yes, but then as more successful competitor ;-)
Doing the homework for somebody else is the smartest move to make sure,
that one person less has learned something.
Thus Poojan reduced the probability, that bckcookie will ever have a
sucessfull job interview. This is great! One competitor less.


All I want to say:
Why make a fuzz about solving other people's home work?
If you have time and don't bother, then do it.
It's the person who didn't try to solve it who will suffer.


On the other hand:
The answer was written about one week after the original post.
Most home work assignments, that I had were needed within one week, so
the answer came probably too late and was thus probably wasted.

N



Poojan Wagh wrote:

assign Y = (M << 2) + M + (N >> 1) + (Q >> 2);
 
On Mar 22, 6:38 pm, Mark McDougall <ma...@vl.com.au> wrote:
Poojan Wagh wrote:
   assign Y = (M << 2) + M + (N >> 1) + (Q >> 2);

You going with him to his job interviews as well?

--
Mark McDougall, Engineer
Virtual Logic Pty Ltd, <http://www.vl.com.au
21-25 King St, Rockdale, 2216
Ph: +612-9599-3255 Fax: +612-9599-3266
You mean I got it right?!
 

Welcome to EDABoard.com

Sponsor

Back
Top