Skip to content

Commit 189b3cb

Browse files
authored
Update PRBS.C
1 parent 2682cc0 commit 189b3cb

File tree

1 file changed

+37
-3
lines changed

1 file changed

+37
-3
lines changed

tutorials/math/PRBS.C

Lines changed: 37 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -27,15 +27,15 @@ void PRBS()
2727
printf("==========================\n");
2828

2929
// PRBS3
30-
std::array<uint16_t, 2> taps3 = {2, 3}; // Exponents of the monic polynomial
30+
std::array<std::uint16_t, 2> taps3 = {3, 2}; // Exponents of the monic polynomial
3131
auto prbs3 = ROOT::Math::LFSR::GenerateSequence(std::bitset<3>().flip(), taps3); // Start value all high
3232

3333
// PRBS4
34-
std::array<uint16_t, 2> taps4 = {3, 4}; // Exponents of the monic polynomial
34+
std::array<std::uint16_t, 2> taps4 = {4, 3}; // Exponents of the monic polynomial
3535
auto prbs4 = ROOT::Math::LFSR::GenerateSequence(std::bitset<4>().flip(), taps4); // Start value all high
3636

3737
// PRBS7
38-
std::array<uint16_t, 2> taps5 = {5, 3}; // Exponents of the monic polynomial
38+
std::array<std:::uint16_t, 2> taps5 = {5, 3}; // Exponents of the monic polynomial
3939
auto prbs5 = ROOT::Math::LFSR::GenerateSequence(std::bitset<5>().flip(), taps5); // Start value all high
4040

4141
for (auto prbs : {prbs3, prbs4, prbs5}) {
@@ -45,4 +45,38 @@ void PRBS()
4545
}
4646
std::cout << std::endl;
4747
}
48+
49+
// Find below all exponents of the monic polynomial extracted from
50+
// Keysight Trueform Series Operating and Service Guide p. 284-285
51+
// auto prbs3 = LFSR(bitset<3>().flip(), std::array<std::uint16_t, 2>{3, 2});
52+
// auto prbs4 = LFSR(bitset<4>().flip(), std::array<std::uint16_t, 2>{4, 3});
53+
// auto prbs5 = LFSR(bitset<5>().flip(), std::array<std::uint16_t, 2>{5, 3});
54+
// auto prbs6 = LFSR(bitset<6>().flip(), std::array<std::uint16_t, 2>{6, 5});
55+
// auto prbs7 = LFSR(bitset<7>().flip(), std::array<std::uint16_t, 2>{7, 6});
56+
// auto prbs8 = LFSR(bitset<8>().flip(), std::array<std::uint16_t, 4>{8, 6, 5, 4});
57+
// auto prbs9 = LFSR(bitset<9>().flip(), std::array<std::uint16_t, 2>{9, 5});
58+
// auto prbs10 = LFSR(bitset<10>().flip(), std::array<std::uint16_t, 2>{10, 7});
59+
// auto prbs11 = LFSR(bitset<11>().flip(), std::array<std::uint16_t, 2>{11, 9});
60+
// auto prbs12 = LFSR(bitset<12>().flip(), std::array<std::uint16_t, 4>{12, 6, 4, 1});
61+
// auto prbs13 = LFSR(bitset<13>().flip(), std::array<std::uint16_t, 4>{13, 4, 3, 1});
62+
// auto prbs14 = LFSR(bitset<14>().flip(), std::array<std::uint16_t, 4>{14, 5, 3, 1});
63+
// auto prbs15 = LFSR(bitset<15>().flip(), std::array<std::uint16_t, 2>{15, 14});
64+
// auto prbs16 = LFSR(bitset<16>().flip(), std::array<std::uint16_t, 4>{16, 15, 13, 4});
65+
// auto prbs17 = LFSR(bitset<17>().flip(), std::array<std::uint16_t, 2>{17, 14});
66+
// auto prbs18 = LFSR(bitset<18>().flip(), std::array<std::uint16_t, 2>{18, 11});
67+
// auto prbs19 = LFSR(bitset<19>().flip(), std::array<std::uint16_t, 4>{19, 6, 2, 1});
68+
// auto prbs20 = LFSR(bitset<20>().flip(), std::array<std::uint16_t, 2>{20, 17});
69+
// auto prbs21 = LFSR(bitset<21>().flip(), std::array<std::uint16_t, 2>{21, 19});
70+
// auto prbs22 = LFSR(bitset<22>().flip(), std::array<std::uint16_t, 2>{22, 21});
71+
// auto prbs23 = LFSR(bitset<23>().flip(), std::array<std::uint16_t, 2>{23, 18});
72+
// auto prbs24 = LFSR(bitset<24>().flip(), std::array<std::uint16_t, 4>{24, 23, 22, 17}, true); // Turn allow wrapping to save memory
73+
// auto prbs25 = LFSR(bitset<25>().flip(), std::array<std::uint16_t, 2>{25, 22}, true); // Turn allow wrapping to save memory
74+
// auto prbs26 = LFSR(bitset<26>().flip(), std::array<std::uint16_t, 4>{26, 6, 2, 1}, true); // Turn allow wrapping to save memory
75+
// auto prbs27 = LFSR(bitset<27>().flip(), std::array<std::uint16_t, 4>{27, 5, 2, 1}, true); // Turn allow wrapping to save memory
76+
// auto prbs28 = LFSR(bitset<28>().flip(), std::array<std::uint16_t, 2>{28, 25}, true); // Turn allow wrapping to save memory
77+
// auto prbs29 = LFSR(bitset<29>().flip(), std::array<std::uint16_t, 4>{29, 27}, true); // Turn allow wrapping to save memory
78+
// auto prbs30 = LFSR(bitset<30>().flip(), std::array<std::uint16_t, 4>{30, 6, 4, 1}, true); // Turn allow wrapping to save memory
79+
// auto prbs31 = LFSR(bitset<31>().flip(), std::array<std::uint16_t, 2>{31, 28}, true); // Turn allow wrapping to save memory
80+
// auto prbs32 = LFSR(bitset<32>().flip(), std::array<std::uint16_t, 4>{32, 22, 2, 1}, true); // Turn allow wrapping to save memory
81+
4882
}

0 commit comments

Comments
 (0)