Tuesday, August 02, 2011

[latbmflb] 32 to 16

Construct a state machine to convert from base 32 to base 16. That is, unpack a stream of tokens in base 32 to a stream of bits internally, then pack those bits 4 at a time into tokens in base 16.

It's sort of simple, at the same time, sort of hairy, trying to get right the conditions of exactly when you can read the next input token or write the next output.

Pretty easy in Bluespec.

No comments :