reading hex file-URGENTTT !!

Discussion in 'VHDL' started by housam, May 5, 2011.

  1. housam

    housam

    Joined:
    May 5, 2011
    Messages:
    1
    Hey, Im not familiar with vhdl code and need an immediate help.
    i need to build a test bench that reads a combined victor of two bits and hex numbers, here's an example:
    reading the victor: 0 0 F0A...3C 0BB...D1 FFF...0F AA0...A0
    that is:

    |Reset (single bit)
    |
    | --- |EN (single bit)
    | --- |
    | --- | - |Ms(128 hex digits)
    | --- | - | ------------ |Hs(64 hex digits)
    | --- | - | ------------ | ------------ |Ss(32 hex digits)
    | --- | - | ------------ | ------------ | ----------- |Ts (16 hex digits)
    0 - 0 - F0A...3C - 0BB...D1 - FFF...0F - AA0...A0

    i heard about library textio but still don't know hoe to use its functions and what parameters
    I will really appreciate if some one can write me a relevant code or help me with that, this is urgent for my project in the university
    (sorry about my bad english level)
    THANKS IN ADVANCE
    housam, May 5, 2011
    #1
    1. Advertising

  2. housam

    slimbobaggins

    Joined:
    May 6, 2011
    Messages:
    4
    Sorry, I don't have time to write code custom to your project cuz I'm struggling through my own code atm, but I have some stuff that can help you...



    Attached Files:

    Last edited: May 6, 2011
    slimbobaggins, May 6, 2011
    #2
    1. Advertising

  3. housam

    slimbobaggins

    Joined:
    May 6, 2011
    Messages:
    4
    jeez, of course the tabbed formatting gets all screwed up

    not sure why my most recent comment disappeared, but change the file extension on the test bench to .vhd, and the others to .hex. this code reads in a 16-bit hex number from each right and left files (represents right and left audio), combines them using a string, and spits them out into output.hex.

    note that each read/write takes 5ns, so set your clock and execution time according.
    Last edited: May 6, 2011
    slimbobaggins, May 6, 2011
    #3
  4. housam

    slimbobaggins

    Joined:
    May 6, 2011
    Messages:
    4
    okay. i had to upload everything as text files because it doesn't all .vhd files. so, after you download the files, change filereader_tb to .vhd extension, and change the other three files to .hex extension.

    what this code does is open up two seperate text files containing 16-bit hex values, combines them into 1 string (32 bits), and spits it out into output.hex. note that each read/write in my test bench requires 5ns, so make sure you run it for the appropriate amount of time.

    http://www.cs.sfu.ca/~ggbaker/reference/std_logic/

    is a website with good reference for textio and other vhdl in general
    slimbobaggins, May 6, 2011
    #4
  5. housam

    slimbobaggins

    Joined:
    May 6, 2011
    Messages:
    4
    urgent, but no response?
    slimbobaggins, May 9, 2011
    #5
    1. Advertising

Want to reply to this thread or ask your own question?

It takes just 2 minutes to sign up (and it's free!). Just click the sign up button to choose a username and then you can ask your own questions on the forum.
Similar Threads
  1. lucanos@gmail.com

    Hex Color Codes - Hex 6 <=> Hex 3

    lucanos@gmail.com, Aug 17, 2005, in forum: HTML
    Replies:
    10
    Views:
    6,127
    Neredbojias
    Aug 19, 2005
  2. Bengt Richter
    Replies:
    6
    Views:
    447
    Juha Autero
    Aug 19, 2003
  3. jack
    Replies:
    4
    Views:
    573
  4. tim

    hex string to hex value

    tim, Nov 22, 2005, in forum: Python
    Replies:
    8
    Views:
    18,787
    mensanator@aol.com
    Nov 23, 2005
  5. tim
    Replies:
    2
    Views:
    1,535
    Dennis Lee Bieber
    Nov 23, 2005
Loading...

Share This Page