VHDL: Reading a text file - text

I know that it is possible to read text files in VHDL as a simulation. But is it possible to read a text file and store it in bits in a register? What I want to achieve is to read some data from a text file and use them as input for a combinational circuit after storing them in a register.

Related

What is the best way to search a large file for hexadecimal and export readable results to a file? (OS Agnostic)

My goal is to search a 500Gb file for a series of hexadecimal characters and to export the results into a text file. I need to automate this, as there are many patterns to be searched.
The results need to include: the location in the file, the 100 preceding hex characters values (represented in both hex and ascii).
As noted, this is OS agnostic (and language agnostic, if anyone suggests scripts or code).

How to output IBM-1027-codepage-binary-file?

My output (csv/json) from my newly-created program (using .NET framework 4.6) need to be converted to a IBM-1027-codepage-binary-file (to be imported to Japanese client's IBM mainframe),
I've search the internet and know that Microsoft doesn't have equivalent to IBM-1027 code page.
So how could I output a IBM-1027-codepage-binary-file if I have an UTF-8 CSV/json file in my hand?
I'm asking around for other solutions, but for now, I think I'm going to have to suggest you do the conversion manually; I assume whichever language you're using allows you to do a hex conversion, at worst. For mainframes, the codepage is usually implicit in the dataset, it isn't something that is included in the file header.
So, what you can do is build a conversion table, from https://www.ibm.com/support/knowledgecenter/en/SSEQ5Y_5.9.0/com.ibm.pcomm.doc/reference/html/hcp_reference26.htm. Grab a character from your json/csv file, convert to the appropriate hex digits, and write those hex digits to a file. Repeat until EOF. (Note to actually write the hex data, not the ascii representation of the hex data.) Make sure that when the client transfers the file to their system, they perform a binary transfer.
If you wanted to get more complicated than that, you could look at enhancing/overriding part of the converter to CP500, which does exist on Microsoft Windows. One of the design points for EBCDIC was to make doing character conversions as simple as possible, so many of the CP500 characters hex representations are the same as the CP1027, with the exception of the Kanji characters.
This is a separate answer, from a colleague; I don't have the ability to validate it, I'm afraid.
transfer the file to the host in raw mode, just tag it as ccsid 1208
(edited)
for uss export _BPXK_AUTOCVT=ALL
oedit/obrowse handles it automatically.

A simple way to turn raw ascii data into sound

I'm looking for method to process simple data into an audio output such as an mp3 file. The data is in the form of a two-column text file with a time signature in milliseconds and a level in millivolts.
Ideally the method would be script-able (with linux or unix tools). I have tried using Audacity to read raw data, however it seems to expect binary files, and doesn't seem to be flexible with sample rates etc.

Jpeg order of encoded mcu blocks

I am trying to encode raw yuv422 bytes from a camera to a jpeg file in c++. I have reviewed different source codes that do this. I am still having trouble understanding the order in which the compressed mcu blocks are placed into the jpeg file. What i would like to do is encode each block in a sequential pattern left to right top to down. What items in the jpeg file govern this (header parameters, zig-zag table...etc)? I presume there must be a parameter(s) becaue it doen't appear that the mcu blocks are always place in the same order, based on the different source codes that i have reviewed. If this is the case how would a jpeg decoder(reader) know the order of the mcu blocks.
Thanks
The MCUs are encoded left to right, top to bottom.
The zig-zag is within a block.

Audio format stored as ascii

Are there any audio formats that are stored in a plain text file? For me it is easier to understand how they are stored and how they are read, rather than reading documentation on binary formats.
No, there is not. You can however easily, using for example a Python interpreter, print out any binary file as numbers.
Just use a hex editor! Much of the relevant information is written in the file header in a human-readable form. Especially with WAV, AIFF or SD2 files.

Resources