source: Deliverables/D4.1/Pretty.ml @ 44

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

Added pretty printing functions for bits, bytes, words etc.

File size: 561 bytes
Line 
1let pretty_bit =
2  function true -> "1"
3         | false -> "0"
4
5let pretty_nibble =
6  function (b1,b2,b3,b4) ->
7    pretty_bit b1 ^ pretty_bit b2 ^ pretty_bit b3 ^ pretty_bit b4
8
9let pretty_byte =
10  function (n1, n2) -> pretty_nibble n1 ^ " " ^ pretty_nibble n2
11
12let pretty_byte7 =
13  function (b1,b2,b3,n) -> "byte7: " ^ pretty_byte ((false,b1,b2,b3), n)
14
15let pretty_word =
16  function (b1,b2) -> pretty_byte b1 ^ " " ^ pretty_byte b2
17
18let pretty_word11 =
19  function (b1,b2,b3,b) ->
20    "word11: " ^ pretty_word (((false,false,false,false),(false,b1,b2,b3)),b)
Note: See TracBrowser for help on using the repository browser.