[Oberon] FPGA - Bit reversal

Alexander Ilin ajsoft at yandex.ru
Sat Sep 23 00:09:50 CEST 2017


Hi, Wojciech!

23.09.2017, 01:04, "Skulski, Wojciech" <skulski at pas.rochester.edu>:
> PROCEDURE ReverseWord(wd: INTEGER): INTEGER;
>  VAR wst: SET; wint: INTEGER;
> BEGIN
>   wst := BITS (wd);
>   wst := - wst;
>   wint := ORD (wst)
>  RETURN wint
> END ReverseWord;
>
> This would be a possibility if BITS were part of the Oberon language. BITS is available in Component Pascal.

  We weren't trying to invert the bits (at least that's how I read your code), we were reordering them.

  Inverting the bits is rather easy in Oberon:
  wst := {0..31} - wst;

---=====--- 
 Александр


More information about the Oberon mailing list