+ Post New Thread
Results 1 to 3 of 3
  1. #1
    Member level 5
    Points: 1,025, Level: 7

    Join Date
    May 2015
    Posts
    85
    Helped
    1 / 1
    Points
    1,025
    Level
    7

    Altering some bits of a RAM location

    Is it possible to alter specific bits of a RAM location?
    For example: A RAM location has some contents(say 00011000), I need to add 4(100) to the contents i.e the contents will be changed to (00011100). Can I just directly invert 2nd bit of the RAM? The only way I know is to generate address of that location in one cycle, in next cycle we will get the contents and alter then and write them back. This consumes two clock cycles. If we can directly send '1' to the second bit location without altering the other bits, it may save a clock cycle(if possible)

    •   AltAdvertisment

        
       

  2. #2
    Advanced Member level 5
    Points: 21,049, Level: 35
    barry's Avatar
    Join Date
    Mar 2005
    Location
    California, USA
    Posts
    4,055
    Helped
    881 / 881
    Points
    21,049
    Level
    35

    Re: Altering some bits of a RAM location

    if you're using block RAM I don't think you can do this. But you could create a RAM with bit-enables; it might take up a lot of resources.



    •   AltAdvertisment

        
       

  3. #3
    Advanced Member level 5
    Points: 36,169, Level: 46
    Achievements:
    7 years registered

    Join Date
    Jun 2010
    Posts
    6,614
    Helped
    1927 / 1927
    Points
    36,169
    Level
    46

    Re: Altering some bits of a RAM location

    The rams usually have byte enable signals, so you can modify individual bytes, but not bit enables.
    At that level, the only way to alter is to read-modify-write.


    1 members found this post helpful.

--[[ ]]--