Notes on using tables
From University of Washington - Ubicomp Research Page
Jump to navigationJump to search
Some byte examples
Here we can see how to create some fixed size tables:
Wiki markup
{| class="wikitable" style="text-align:center" !colspan="2" style="width:70px" | Byte 0 !! colspan="2" style="width:70px" | Byte 1 !!colspan="2" style="width:70px" | Byte 2 !!colspan="2" style="width:70px" | Byte 3 !!colspan="2" style="width:70px" | Byte 4 !! colspan="2" style="width:70px" | Byte 5 |- |style="width:35px"| '!' || 0x21 || style="width:35px"| 'b' || 0x62 || colspan="8" style="background:#ABCDEF;" | Argument |} {| class="wikitable" style="text-align:center" !colspan="2" style="width:70px" | Byte 0 !! colspan="2" style="width:70px" | Byte 1 !!colspan="2" style="width:70px" | Byte 2 !!colspan="2" style="width:70px" | Byte 3 !!colspan="2" style="width:70px" | Byte 4 !! colspan="2" style="width:70px" | Byte 5 |- |style="width:35px"| '!' || 0x21 || style="width:35px"| 'b' || 0x62 || colspan="2" style="background:#ABCDEF;" | 0x01 || colspan="2" style="background:#ABCDEF;" | 0x02 || colspan="2" style="background:#ABCDEF;" | 0x03 || colspan="2" style="background:#ABCDEF;" | 0x04 |- |colspan="2" style="width:70px;" | || colspan="2" style="width:70px" | || colspan="8" style="width:280px; background:#ABCDEF;" | Argument |}
Results
Byte 0 | Byte 1 | Byte 2 | Byte 3 | Byte 4 | Byte 5 | ||||||
---|---|---|---|---|---|---|---|---|---|---|---|
'!' | 0x21 | 'b' | 0x62 | Argument |
Byte 0 | Byte 1 | Byte 2 | Byte 3 | Byte 4 | Byte 5 | ||||||
---|---|---|---|---|---|---|---|---|---|---|---|
'!' | 0x21 | 'b' | 0x62 | 0x01 | 0x02 | 0x03 | 0x04 | ||||
Argument |
Some bit field examples
Here we can see how to create some fixed size tables:
Wiki markup
Normal table {| class="wikitable" !style="width:35px"| Bit 7 !! style="width:35px"| Bit 6 !! style="width:35px"| Bit 5 !! style="width:35px"| Bit 4 !! style="width:35px"| Bit 3 !! style="width:35px"| Bit 2 !! style="width:35px"| Bit 1 !! style="width:35px"| Bit 0 |- | 0 || 0 || 0 || 0 || 0 || 0 || 0 || 0 |} Table with highlighed background: {| class="wikitable" !style="width:35px; background:#ABCDEF;" | Bit 0 !! style="width:35px"| Bit 1 !! style="width:35px"| Bit 2 !! style="width:35px"| Bit 3 !! style="width:35px"| Bit 4 !! style="width:35px"| Bit 5 !! style="width:35px"| Bit 6 !! style="width:35px"| Bit 7 |- | style="background:#ABCDEF;" | 0 || 0 || 0 || 0 || 0 || 0 || 0 || 0 |} Table with incomplete cols and centering: {| class="wikitable" style="text-align:center" !style="width:35px"| Bit 15 !! style="width:35px"| Bit 14 !! style="width:35px"| Bit 13 !! style="width:35px"| Bit 12 !! style="width:35px"| Bit 11 !! style="width:35px"| Bit 10 !! style="width:35px"| Bit 9 !! style="width:35px"| Bit 8 !! style="width:35px"| Bit 7 !! style="width:35px"| Bit 6 !! style="width:35px"| Bit 5 !! style="width:35px"| Bit 4 !! style="width:35px"| Bit 3 !! style="width:35px"| Bit 2 !! style="width:35px"| Bit 1 !! style="width:35px"| Bit 0 |- |style="background:#ABCDEF;"| 0x8000 || style="background:#ABCDEF;"| 0x4000 || style="background:#ABCDEF;"| 0x2000 || style="background:#ABCDEF;"| 0x1000 || style="background:#ABCDEF;"| 0x0800 || style="background:#ABCDEF;"| 0x0400 || style="background:#ABCDEF;"| 0x0200 || style="background:#ABCDEF;"| 0x0100 || style="background:#ABCDEF;"| 0x0080 || style="background:#ABCDEF;"| 0x0040 || style="background:#ABCDEF;"| 0x0020 || style="background:#ABCDEF;"| 0x0010 || style="background:#ABCDEF;"| 0x0008 || style="background:#ABCDEF;"| 0x0004 || style="background:#ABCDEF;"| 0x0002 || style="background:#ABCDEF;"| 0x0001 |- | 0 || 0 || 0 || 0 || 0 || 0 || 0 || 0 |}
Results
-
Normal table
Bit 7 | Bit 6 | Bit 5 | Bit 4 | Bit 3 | Bit 2 | Bit 1 | Bit 0 |
---|---|---|---|---|---|---|---|
0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 |
Table with highlighed background:
Bit 0 | Bit 1 | Bit 2 | Bit 3 | Bit 4 | Bit 5 | Bit 6 | Bit 7 |
---|---|---|---|---|---|---|---|
0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 |
Table with incomplete cols and centering:
Bit 15 | Bit 14 | Bit 13 | Bit 12 | Bit 11 | Bit 10 | Bit 9 | Bit 8 | Bit 7 | Bit 6 | Bit 5 | Bit 4 | Bit 3 | Bit 2 | Bit 1 | Bit 0 |
---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|
0x8000 | 0x4000 | 0x2000 | 0x1000 | 0x0800 | 0x0400 | 0x0200 | 0x0100 | 0x0080 | 0x0040 | 0x0020 | 0x0010 | 0x0008 | 0x0004 | 0x0002 | 0x0001 |
0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 |
Notes
-
Table of bitmasks for 16-bit numbers:
Bit No | Bit fields | Decimal | Hex |
---|---|---|---|
15 | 10000000 00000000 | 32768 | 0x8000 |
14 | 01000000 00000000 | 16384 | 0x4000 |
13 | 00100000 00000000 | 8192 | 0x2000 |
12 | 00010000 00000000 | 4096 | 0x1000 |
11 | 00001000 00000000 | 2048 | 0x0800 |
10 | 00000100 00000000 | 1024 | 0x0400 |
09 | 00000010 00000000 | 512 | 0x0200 |
08 | 00000001 00000000 | 256 | 0x0100 |
07 | 00000000 10000000 | 128 | 0x0080 |
06 | 00000000 01000000 | 64 | 0x0040 |
05 | 00000000 00100000 | 32 | 0x0020 |
04 | 00000000 00010000 | 16 | 0x0010 |
03 | 00000000 00001000 | 8 | 0x0008 |
02 | 00000000 00000100 | 4 | 0x0004 |
01 | 00000000 00000010 | 2 | 0x0002 |
00 | 00000000 00000001 | 1 | 0x0001 |
Bit No | Bit fields | Decimal | Hex |
---|---|---|---|
31 | 10000000 00000000 00000000 00000000 | 2147483648 | 0x80000000 |
30 | 01000000 00000000 00000000 00000000 | 1073741824 | 0x40000000 |
29 | 00100000 00000000 00000000 00000000 | 536870912 | 0x20000000 |
28 | 00010000 00000000 00000000 00000000 | 268435456 | 0x10000000 |
27 | 00001000 00000000 00000000 00000000 | 134217728 | 0x08000000 |
26 | 00000100 00000000 00000000 00000000 | 67108864 | 0x04000000 |
25 | 00000010 00000000 00000000 00000000 | 33554432 | 0x02000000 |
24 | 00000001 00000000 00000000 00000000 | 16777216 | 0x01000000 |
23 | 00000000 10000000 00000000 00000000 | 8388608 | 0x00800000 |
22 | 00000000 01000000 00000000 00000000 | 4194304 | 0x00400000 |
21 | 00000000 00100000 00000000 00000000 | 2097152 | 0x00200000 |
20 | 00000000 00010000 00000000 00000000 | 1048576 | 0x00100000 |
19 | 00000000 00001000 00000000 00000000 | 524288 | 0x00080000 |
18 | 00000000 00000100 00000000 00000000 | 262144 | 0x00040000 |
17 | 00000000 00000010 00000000 00000000 | 131072 | 0x00020000 |
16 | 00000000 00000001 00000000 00000000 | 65536 | 0x00010000 |
15 | 00000000 00000000 10000000 00000000 | 32768 | 0x00008000 |
14 | 00000000 00000000 01000000 00000000 | 16384 | 0x00004000 |
13 | 00000000 00000000 00100000 00000000 | 8192 | 0x00002000 |
12 | 00000000 00000000 00010000 00000000 | 4096 | 0x00001000 |
11 | 00000000 00000000 00001000 00000000 | 2048 | 0x00000800 |
10 | 00000000 00000000 00000100 00000000 | 1024 | 0x00000400 |
09 | 00000000 00000000 00000010 00000000 | 512 | 0x00000200 |
08 | 00000000 00000000 00000001 00000000 | 256 | 0x00000100 |
07 | 00000000 00000000 00000000 10000000 | 128 | 0x00000080 |
06 | 00000000 00000000 00000000 01000000 | 64 | 0x00000040 |
05 | 00000000 00000000 00000000 00100000 | 32 | 0x00000020 |
04 | 00000000 00000000 00000000 00010000 | 16 | 0x00000010 |
03 | 00000000 00000000 00000000 00001000 | 8 | 0x00000008 |
02 | 00000000 00000000 00000000 00000100 | 4 | 0x00000004 |
01 | 00000000 00000000 00000000 00000010 | 2 | 0x00000002 |
00 | 00000000 00000000 00000000 00000001 | 1 | 0x00000001 |