-
Notifications
You must be signed in to change notification settings - Fork 2
/
make_TPM.m
42 lines (39 loc) · 1.67 KB
/
make_TPM.m
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
N = 4;
p = zeros(2^N,N);
% 1 0000 1000 none 0110 1110 0001 0101 1011 1111
% 2 0000 1100 1010 0001 0011 1011 0111 1111
% 3 0000 1010 0110 0001 1001 0101 1101 1111
% 4 1100 0010 0110 1110 0001 1001 1011 0111
i = 1; % 0000
p(i,1) = 0; p(i,2) = 0; p(i,3) = 0; p(i,4) = 1;
i = 2; % 1000
p(i,1) = 0; p(i,2) = 1; p(i,3) = 1; p(i,4) = 1;
i = 3; % 0100
p(i,1) = 1; p(i,2) = 1; p(i,3) = 1; p(i,4) = 1;
i = 4; % 1100
p(i,1) = 1; p(i,2) = 0; p(i,3) = 1; p(i,4) = 0;
i = 5; % 0010
p(i,1) = 1; p(i,2) = 1; p(i,3) = 1; p(i,4) = 0;
i = 6; % 1010
p(i,1) = 1; p(i,2) = 0; p(i,3) = 0; p(i,4) = 1;
i = 7; % 0110
p(i,1) = 0; p(i,2) = 1; p(i,3) = 1; p(i,4) = 0;
i = 8; % 1110
p(i,1) = 0; p(i,2) = 1; p(i,3) = 1; p(i,4) = 0;
i = 9; % 0001
p(i,1) = 0; p(i,2) = 0; p(i,3) = 0; p(i,4) = 0;
i = 10; % 1001
p(i,1) = 1; p(i,2) = 1; p(i,3) = 0; p(i,4) = 0;
i = 11; % 0101
p(i,1) = 0; p(i,2) = 1; p(i,3) = 0; p(i,4) = 1;
i = 12; % 1101
p(i,1) = 1; p(i,2) = 1; p(i,3) = 0; p(i,4) = 1;
i = 13; % 0011
p(i,1) = 1; p(i,2) = 0; p(i,3) = 1; p(i,4) = 1;
i = 14; % 1011
p(i,1) = 0; p(i,2) = 0; p(i,3) = 1; p(i,4) = 0;
i = 15; % 0111
p(i,1) = 1; p(i,2) = 0; p(i,3) = 1; p(i,4) = 0;
i = 16; % 1111
p(i,1) = 0; p(i,2) = 0; p(i,3) = 0; p(i,4) = 1;
save TPM p