Commit 4cf9f6ef by Quentin Aristote

### deletion

parent cc07d4e9
 (* --------------------------- VARIABLES GLOBALES --------------------------- *) const ops_nbr_length = 8 (* devrait suffire jusqu'à 256 lignes d'assembleur ; est aussi la longueur du nombre d'opérations par seconde *) (* ---------------------------------- UAL ---------------------------------- *) zeros() = o:[n] where if n = 0 then o = [] else o = 0.zeros() end if end where ones() = o:[n] where if n = 0 then o = [] else o = 1.ones() end if end where multi_and(a:[n], b:[n]) = o:[n] where if n = 0 then o = [] else o = (a[0] & b[0]).multi_and(a[1..], b[1..]) end if end where multi_or(a:[n], b:[n]) = o:[n] where if n = 0 then o = []; else o = (a[0] + b[0]).multi_or(a[1..], b[1..]) end if end where multi_xor(a:[n], b:[n]) = o:[n] where if n = 0 then o = []; else o = (a[0] ^ b[0]).multi_xor(a[1..],b[1..]) end if end where (* bizzarement le cas n = 0 fait tout bugger *) multi_not(a:[n]) = o:[n] where if n = 1 then o = not(a) else o = not(a[0]).multi_not(a[1..]) end if end where multi_nor(a:[n], b:[n]) = o:[n] where o = multi_not(multi_or(a, b)) end where multi_mux(c, a:[n], b:[n]) = o:[n] where if n = 0 then o = [] else o = mux(c, a[0], b[0]).multi_mux(c, a[1..n-1], b[1..n-1]) end if end where add(a:[n], b:[n], c_in) = (o:[n], c_out) where if n = 0 then o = [] ; c_out = 0 else (tail, c) = add(a[1..], b[1..], c_in) ; tmp = a[0] ^ b[0] ; o = (tmp ^ c).tail ; c_out = (tmp & c) + (a[0] & b[0]) end if end where (* a - b *) sub(a:[n], b:[n]) = o:[n] where (o, c) = add(a, multi_not(b), 1) end where (* a >= 0 *) gez(a:[n]) = o where (* a >= 0 ssi son bit de signe est nul *) o = not(a[0]) end where (* a = 0 *) ez(a:[n]) = o where if n = 0 then o = 0 else o = not(a[0]) & ez(a[1..]) end if end where (* a > O *) gz(a:[n]) = o where o = not(a[0] + ez(a)) end where (* a < 0 *) lz(a:[n]) = o where o = a[0] end where (* a <= 0 *) lez(a:[n]) = o where o = a[0] + ez(a) end where (* On fait le shift p fois *) sll(a:[n], shamt:[m]) = o:[n] where if m = 0 then o = a else o = sll(multi_mux(shamt[m-1], a[..n-(p+1)].zeros

(), a), shamt[..m-2]) end if end where srl(a:[n], shamt:[m]) = o:[n] where if m = 0 then o = a else o = srl(multi_mux(shamt[m-1], zeros

().a[p..], a), shamt[..m-2]) end if end where sra(a:[n], shamt:[m]) = o:[n] where if m = 0 then o = a else o = sra(multi_mux(shamt[m-1], ones