Email: Password: Remember Me | Create Account (Free)

Back to Subject List

Old thread has been locked -- no new posts accepted in this thread
???
01/11/07 19:07
Read: times


 
#130691 - ugh
Responding to: ???'s previous message
Suresh R said:
assign bf_out = (ctr0_slect = 1'b1 && ctr0_RW = 1'b0)?(rd_bk = 1'b1 && ctrl_data[4] = 1'b0?
status_latch:[5:4]ctrl_data = 2'b01?OLl:[5:4]ctrl_data = 2'b10?OLm:[5:4]ctrl_data = 2'b11??...

Ugh, where to begin?

The bit-selects [5:4] belong AFTER the reg/wire name, i.e.,
foo = bar[5:4]
(assuming foo is two bits wide).

In the above code sample, LHS 'net' bf_out is 8- bit and all the 'reg' on RHS are also 8 - bit each.
Here for the combination "[5:4]ctrl_data = 2'b11" i need to send both OLl and OLm (OLl 8 bit and OLm 8 bit)to bf_out.
can any one tell me whether it could be done using assign statement.


You can't "send" (which I read as "assign") two 8-bit signals to one 8-bit signal at the same time; that makes no sense.

You're basically building a mux with a somewhat-complicated selector. Break up your code into two assignment statements, one to deal with the selector and one to do the mux assign based on that selector. You could also do the whole thing in an always block. Just don't string everything along in one huge messy line. If I was reviewing your code, I'd bounce it back.

-a


List of 28 messages in thread
TopicAuthorDate
data flow modeling in Verilog            01/01/70 00:00      
   How to post code            01/01/70 00:00      
   proper code...            01/01/70 00:00      
      Break up your code into smaller pieces            01/01/70 00:00      
         Thanks            01/01/70 00:00      
         what does that have to do with verilog? :)            01/01/70 00:00      
      Verilog bites like C            01/01/70 00:00      
         yes sorry. i made a mistake there.            01/01/70 00:00      
      ugh            01/01/70 00:00      
         details            01/01/70 00:00      
            dont use a bidirectional bus            01/01/70 00:00      
               regarding using seperate buses..            01/01/70 00:00      
                  out signal to status register            01/01/70 00:00      
                     hints            01/01/70 00:00      
                        Absolutely.            01/01/70 00:00      
                        Since \'diomux\' is a register....            01/01/70 00:00      
                           re: Since 'diomux' is a register ...            01/01/70 00:00      
                              regarding write and read operations...            01/01/70 00:00      
                                 re: regarding write and read ops            01/01/70 00:00      
                                    thank you..            01/01/70 00:00      
   Yukky verilog            01/01/70 00:00      
      Yes i did            01/01/70 00:00      
   all you do is...            01/01/70 00:00      
       can i do like this.,            01/01/70 00:00      
         if it's in BUFFER mode ...            01/01/70 00:00      
            buffer mode ports from the vhdl faq            01/01/70 00:00      
         mode out on RHS            01/01/70 00:00      
            very good Solutions!            01/01/70 00:00      

Back to Subject List