source: Deliverables/D4.1/Word.ml @ 63

Last change on this file since 63 was 63, checked in by mulligan, 10 years ago

More work on bits, bytes, nibbles, and added modules for byte7s and
words.

File size: 977 bytes
Line 
1(*^*^*^*^*^*^*^*^*^*^*^*^*^*^*^*^*^*^*^*^*^*^*^*^*^*^*^*^*^*^*^*^*^*^*^*^*^*^*)
2(* FILENAME:    Byte.ml                                                      *)
3(* DESCRIPTION: An ADT implementing standard 8 bit bytes, and common         *)
4(*              operations on them.                                          *)
5(* CREATED:     13/09/2010, Dominic Mulligan                                 *)
6(* BUGS:                                                                     *)
7(*^*^*^*^*^*^*^*^*^*^*^*^*^*^*^*^*^*^*^*^*^*^*^*^*^*^*^*^*^*^*^*^*^*^*^*^*^*^*)
8
9use "Bit.ml";;
10use "Nibble.ml";;
11use "Byte.ml";;
12
13module type WORD =
14sig
15  type bit
16  type nibble
17  type byte
18  type word
19end;;
20
21module Word(Bit: BIT,
22            Nibble: NIBBLE,
23            Byte: BYTE)
24  with type bit    = Bit.bit
25  and  type nibble = Nibble.nibble
26  and  type byte   = Byte.byte =
27struct
28  type bit = Bit.bit
29  type nibble = Nibble.nibble
30  type byte = Byte.byte
31  type word = (byte * byte)
32end;;
Note: See TracBrowser for help on using the repository browser.