Home › Practice › RTL Design › 16-bit byte swap (network order)
16-bit byte swap (network order)
EasyRTLHFTcombinational
Market data feeds arrive in network byte order (big-endian), where the high byte comes first, while local logic often reads little-endian.
Concept first. Swapping two bytes in hardware is just rewiring: bit slice din[15:8] becomes the lower byte and din[7:0] becomes the upper byte. When swap_en=0, pass din straight through unchanged. After passing, click Check area and speed to inspect the OpenSTA clock speed.
- When
swap_en=1,dout = {din[7:0], din[15:8]}. - When
swap_en=0,dout = din. - No clock.
No install and no sign-up needed. You write your answer in the editor and Nishkam checks it.