From af8c91901078c0ded0aa960693c55ee977ba0a8c Mon Sep 17 00:00:00 2001 From: Brian Neff Date: Mon, 16 Mar 2026 13:37:26 -0400 Subject: [PATCH 1/2] Added MC Files for Digital Up and Down Conversion for Full Rate MC --- .../DigitalUpDownConversion/cos_lut.mem | 4096 +++++++++++++++++ mc/Advanced/DigitalUpDownConversion/design.v | 707 +++ .../DigitalUpDownConversion/sin_lut.mem | 4096 +++++++++++++++++ 3 files changed, 8899 insertions(+) create mode 100644 mc/Advanced/DigitalUpDownConversion/cos_lut.mem create mode 100644 mc/Advanced/DigitalUpDownConversion/design.v create mode 100644 mc/Advanced/DigitalUpDownConversion/sin_lut.mem diff --git a/mc/Advanced/DigitalUpDownConversion/cos_lut.mem b/mc/Advanced/DigitalUpDownConversion/cos_lut.mem new file mode 100644 index 0000000..a1c9970 --- /dev/null +++ b/mc/Advanced/DigitalUpDownConversion/cos_lut.mem @@ -0,0 +1,4096 @@ +7fff +7fff +7fff +7fff +7ffe +7ffe +7ffe +7ffd +7ffd +7ffc +7ffb +7ffa +7ff9 +7ff8 +7ff7 +7ff6 +7ff5 +7ff4 +7ff3 +7ff1 +7ff0 +7fee +7fec +7feb +7fe9 +7fe7 +7fe5 +7fe3 +7fe1 +7fdf +7fdc +7fda +7fd8 +7fd5 +7fd2 +7fd0 +7fcd +7fca +7fc7 +7fc4 +7fc1 +7fbe +7fbb +7fb8 +7fb4 +7fb1 +7fad +7faa +7fa6 +7fa2 +7f9f +7f9b +7f97 +7f93 +7f8f +7f8a +7f86 +7f82 +7f7d +7f79 +7f74 +7f70 +7f6b +7f66 +7f61 +7f5c +7f57 +7f52 +7f4d +7f48 +7f42 +7f3d +7f37 +7f32 +7f2c +7f26 +7f21 +7f1b +7f15 +7f0f +7f09 +7f02 +7efc +7ef6 +7eef +7ee9 +7ee2 +7edc +7ed5 +7ece +7ec7 +7ec0 +7eb9 +7eb2 +7eab +7ea4 +7e9c +7e95 +7e8d +7e86 +7e7e +7e77 +7e6f +7e67 +7e5f +7e57 +7e4f +7e47 +7e3e +7e36 +7e2e +7e25 +7e1d +7e14 +7e0b +7e02 +7dfa +7df1 +7de8 +7ddf +7dd5 +7dcc +7dc3 +7db9 +7db0 +7da6 +7d9d +7d93 +7d89 +7d80 +7d76 +7d6c +7d62 +7d57 +7d4d +7d43 +7d39 +7d2e +7d24 +7d19 +7d0e +7d04 +7cf9 +7cee +7ce3 +7cd8 +7ccd +7cc1 +7cb6 +7cab +7c9f +7c94 +7c88 +7c7d +7c71 +7c65 +7c59 +7c4d +7c41 +7c35 +7c29 +7c1d +7c10 +7c04 +7bf8 +7beb +7bde +7bd2 +7bc5 +7bb8 +7bab +7b9e +7b91 +7b84 +7b77 +7b69 +7b5c +7b4f +7b41 +7b33 +7b26 +7b18 +7b0a +7afc +7aee +7ae0 +7ad2 +7ac4 +7ab6 +7aa8 +7a99 +7a8b +7a7c +7a6d +7a5f +7a50 +7a41 +7a32 +7a23 +7a14 +7a05 +79f6 +79e6 +79d7 +79c8 +79b8 +79a9 +7999 +7989 +7979 +796a +795a +794a +7939 +7929 +7919 +7909 +78f8 +78e8 +78d7 +78c7 +78b6 +78a5 +7894 +7884 +7873 +7862 +7850 +783f +782e +781d +780b +77fa +77e8 +77d7 +77c5 +77b3 +77a1 +778f +777d +776b +7759 +7747 +7735 +7722 +7710 +76fe +76eb +76d8 +76c6 +76b3 +76a0 +768d +767a +7667 +7654 +7641 +762d +761a +7607 +75f3 +75e0 +75cc +75b8 +75a5 +7591 +757d +7569 +7555 +7541 +752d +7518 +7504 +74f0 +74db +74c6 +74b2 +749d +7488 +7474 +745f +744a +7435 +7420 +740a +73f5 +73e0 +73ca +73b5 +739f +738a +7374 +735e +7349 +7333 +731d +7307 +72f1 +72db +72c4 +72ae +7298 +7281 +726b +7254 +723e +7227 +7210 +71f9 +71e2 +71cb +71b4 +719d +7186 +716f +7158 +7140 +7129 +7111 +70fa +70e2 +70ca +70b2 +709b +7083 +706b +7053 +703a +7022 +700a +6ff2 +6fd9 +6fc1 +6fa8 +6f90 +6f77 +6f5e +6f45 +6f2c +6f14 +6efb +6ee1 +6ec8 +6eaf +6e96 +6e7c +6e63 +6e4a +6e30 +6e16 +6dfd +6de3 +6dc9 +6daf +6d95 +6d7b +6d61 +6d47 +6d2d +6d13 +6cf8 +6cde +6cc3 +6ca9 +6c8e +6c74 +6c59 +6c3e +6c23 +6c08 +6bed +6bd2 +6bb7 +6b9c +6b81 +6b65 +6b4a +6b2f +6b13 +6af8 +6adc +6ac0 +6aa4 +6a89 +6a6d +6a51 +6a35 +6a19 +69fd +69e0 +69c4 +69a8 +698b +696f +6952 +6936 +6919 +68fc +68e0 +68c3 +68a6 +6889 +686c +684f +6832 +6814 +67f7 +67da +67bc +679f +6781 +6764 +6746 +6728 +670a +66ed +66cf +66b1 +6693 +6675 +6656 +6638 +661a +65fc +65dd +65bf +65a0 +6582 +6563 +6544 +6525 +6507 +64e8 +64c9 +64aa +648b +646c +644c +642d +640e +63ee +63cf +63af +6390 +6370 +6351 +6331 +6311 +62f1 +62d1 +62b1 +6291 +6271 +6251 +6231 +6211 +61f0 +61d0 +61af +618f +616e +614e +612d +610c +60eb +60cb +60aa +6089 +6068 +6047 +6025 +6004 +5fe3 +5fc2 +5fa0 +5f7f +5f5d +5f3c +5f1a +5ef8 +5ed7 +5eb5 +5e93 +5e71 +5e4f +5e2d +5e0b +5de9 +5dc7 +5da5 +5d82 +5d60 +5d3e +5d1b +5cf9 +5cd6 +5cb3 +5c91 +5c6e +5c4b +5c28 +5c05 +5be2 +5bbf +5b9c +5b79 +5b56 +5b33 +5b0f +5aec +5ac9 +5aa5 +5a82 +5a5e +5a3b +5a17 +59f3 +59cf +59ac +5988 +5964 +5940 +591c +58f8 +58d3 +58af +588b +5867 +5842 +581e +57f9 +57d5 +57b0 +578b +5767 +5742 +571d +56f8 +56d3 +56af +568a +5664 +563f +561a +55f5 +55d0 +55aa +5585 +5560 +553a +5515 +54ef +54c9 +54a4 +547e +5458 +5432 +540c +53e7 +53c1 +539b +5374 +534e +5328 +5302 +52dc +52b5 +528f +5268 +5242 +521b +51f5 +51ce +51a8 +5181 +515a +5133 +510c +50e5 +50be +5097 +5070 +5049 +5022 +4ffb +4fd4 +4fac +4f85 +4f5d +4f36 +4f0e +4ee7 +4ebf +4e98 +4e70 +4e48 +4e20 +4df9 +4dd1 +4da9 +4d81 +4d59 +4d31 +4d09 +4ce0 +4cb8 +4c90 +4c68 +4c3f +4c17 +4bee +4bc6 +4b9d +4b75 +4b4c +4b24 +4afb +4ad2 +4aa9 +4a80 +4a58 +4a2f +4a06 +49dd +49b4 +498a +4961 +4938 +490f +48e5 +48bc +4893 +4869 +4840 +4816 +47ed +47c3 +479a +4770 +4746 +471c +46f3 +46c9 +469f +4675 +464b +4621 +45f7 +45cd +45a3 +4578 +454e +4524 +44f9 +44cf +44a5 +447a +4450 +4425 +43fb +43d0 +43a5 +437b +4350 +4325 +42fa +42d0 +42a5 +427a +424f +4224 +41f9 +41ce +41a2 +4177 +414c +4121 +40f6 +40ca +409f +4073 +4048 +401d +3ff1 +3fc5 +3f9a +3f6e +3f43 +3f17 +3eeb +3ebf +3e93 +3e68 +3e3c +3e10 +3de4 +3db8 +3d8c +3d60 +3d33 +3d07 +3cdb +3caf +3c83 +3c56 +3c2a +3bfe +3bd1 +3ba5 +3b78 +3b4c +3b1f +3af2 +3ac6 +3a99 +3a6c +3a40 +3a13 +39e6 +39b9 +398c +3960 +3933 +3906 +38d9 +38ab +387e +3851 +3824 +37f7 +37ca +379c +376f +3742 +3715 +36e7 +36ba +368c +365f +3631 +3604 +35d6 +35a8 +357b +354d +351f +34f2 +34c4 +3496 +3468 +343a +340c +33df +33b1 +3383 +3355 +3326 +32f8 +32ca +329c +326e +3240 +3211 +31e3 +31b5 +3187 +3158 +312a +30fb +30cd +309e +3070 +3041 +3013 +2fe4 +2fb6 +2f87 +2f58 +2f2a +2efb +2ecc +2e9d +2e6e +2e40 +2e11 +2de2 +2db3 +2d84 +2d55 +2d26 +2cf7 +2cc8 +2c99 +2c6a +2c3a +2c0b +2bdc +2bad +2b7d +2b4e +2b1f +2af0 +2ac0 +2a91 +2a61 +2a32 +2a02 +29d3 +29a3 +2974 +2944 +2915 +28e5 +28b5 +2886 +2856 +2826 +27f7 +27c7 +2797 +2767 +2737 +2708 +26d8 +26a8 +2678 +2648 +2618 +25e8 +25b8 +2588 +2558 +2528 +24f8 +24c8 +2497 +2467 +2437 +2407 +23d7 +23a6 +2376 +2346 +2315 +22e5 +22b5 +2284 +2254 +2223 +21f3 +21c2 +2192 +2161 +2131 +2100 +20d0 +209f +206f +203e +200d +1fdd +1fac +1f7b +1f4a +1f1a +1ee9 +1eb8 +1e87 +1e57 +1e26 +1df5 +1dc4 +1d93 +1d62 +1d31 +1d00 +1ccf +1c9e +1c6d +1c3c +1c0b +1bda +1ba9 +1b78 +1b47 +1b16 +1ae5 +1ab4 +1a82 +1a51 +1a20 +19ef +19be +198c +195b +192a +18f9 +18c7 +1896 +1865 +1833 +1802 +17d0 +179f +176e +173c +170b +16d9 +16a8 +1676 +1645 +1613 +15e2 +15b0 +157f +154d +151c +14ea +14b9 +1487 +1455 +1424 +13f2 +13c0 +138f +135d +132b +12fa +12c8 +1296 +1264 +1233 +1201 +11cf +119d +116c +113a +1108 +10d6 +10a4 +1072 +1041 +100f +0fdd +0fab +0f79 +0f47 +0f15 +0ee3 +0eb1 +0e80 +0e4e +0e1c +0dea +0db8 +0d86 +0d54 +0d22 +0cf0 +0cbe +0c8c +0c5a +0c28 +0bf6 +0bc4 +0b92 +0b5f +0b2d +0afb +0ac9 +0a97 +0a65 +0a33 +0a01 +09cf +099d +096a +0938 +0906 +08d4 +08a2 +0870 +083e +080b +07d9 +07a7 +0775 +0743 +0711 +06de +06ac +067a +0648 +0616 +05e3 +05b1 +057f +054d +051b +04e8 +04b6 +0484 +0452 +041f +03ed +03bb +0389 +0356 +0324 +02f2 +02c0 +028d +025b +0229 +01f7 +01c4 +0192 +0160 +012e +00fb +00c9 +0097 +0065 +0032 +0000 +ffce +ff9b +ff69 +ff37 +ff05 +fed2 +fea0 +fe6e +fe3c +fe09 +fdd7 +fda5 +fd73 +fd40 +fd0e +fcdc +fcaa +fc77 +fc45 +fc13 +fbe1 +fbae +fb7c +fb4a +fb18 +fae5 +fab3 +fa81 +fa4f +fa1d +f9ea +f9b8 +f986 +f954 +f922 +f8ef +f8bd +f88b +f859 +f827 +f7f5 +f7c2 +f790 +f75e +f72c +f6fa +f6c8 +f696 +f663 +f631 +f5ff +f5cd +f59b +f569 +f537 +f505 +f4d3 +f4a1 +f46e +f43c +f40a +f3d8 +f3a6 +f374 +f342 +f310 +f2de +f2ac +f27a +f248 +f216 +f1e4 +f1b2 +f180 +f14f +f11d +f0eb +f0b9 +f087 +f055 +f023 +eff1 +efbf +ef8e +ef5c +ef2a +eef8 +eec6 +ee94 +ee63 +ee31 +edff +edcd +ed9c +ed6a +ed38 +ed06 +ecd5 +eca3 +ec71 +ec40 +ec0e +ebdc +ebab +eb79 +eb47 +eb16 +eae4 +eab3 +ea81 +ea50 +ea1e +e9ed +e9bb +e98a +e958 +e927 +e8f5 +e8c4 +e892 +e861 +e830 +e7fe +e7cd +e79b +e76a +e739 +e707 +e6d6 +e6a5 +e674 +e642 +e611 +e5e0 +e5af +e57e +e54c +e51b +e4ea +e4b9 +e488 +e457 +e426 +e3f5 +e3c4 +e393 +e362 +e331 +e300 +e2cf +e29e +e26d +e23c +e20b +e1da +e1a9 +e179 +e148 +e117 +e0e6 +e0b6 +e085 +e054 +e023 +dff3 +dfc2 +df91 +df61 +df30 +df00 +decf +de9f +de6e +de3e +de0d +dddd +ddac +dd7c +dd4b +dd1b +dceb +dcba +dc8a +dc5a +dc29 +dbf9 +dbc9 +db99 +db69 +db38 +db08 +dad8 +daa8 +da78 +da48 +da18 +d9e8 +d9b8 +d988 +d958 +d928 +d8f8 +d8c9 +d899 +d869 +d839 +d809 +d7da +d7aa +d77a +d74b +d71b +d6eb +d6bc +d68c +d65d +d62d +d5fe +d5ce +d59f +d56f +d540 +d510 +d4e1 +d4b2 +d483 +d453 +d424 +d3f5 +d3c6 +d396 +d367 +d338 +d309 +d2da +d2ab +d27c +d24d +d21e +d1ef +d1c0 +d192 +d163 +d134 +d105 +d0d6 +d0a8 +d079 +d04a +d01c +cfed +cfbf +cf90 +cf62 +cf33 +cf05 +ced6 +cea8 +ce79 +ce4b +ce1d +cdef +cdc0 +cd92 +cd64 +cd36 +cd08 +ccda +ccab +cc7d +cc4f +cc21 +cbf4 +cbc6 +cb98 +cb6a +cb3c +cb0e +cae1 +cab3 +ca85 +ca58 +ca2a +c9fc +c9cf +c9a1 +c974 +c946 +c919 +c8eb +c8be +c891 +c864 +c836 +c809 +c7dc +c7af +c782 +c755 +c727 +c6fa +c6cd +c6a0 +c674 +c647 +c61a +c5ed +c5c0 +c594 +c567 +c53a +c50e +c4e1 +c4b4 +c488 +c45b +c42f +c402 +c3d6 +c3aa +c37d +c351 +c325 +c2f9 +c2cd +c2a0 +c274 +c248 +c21c +c1f0 +c1c4 +c198 +c16d +c141 +c115 +c0e9 +c0bd +c092 +c066 +c03b +c00f +bfe3 +bfb8 +bf8d +bf61 +bf36 +bf0a +bedf +beb4 +be89 +be5e +be32 +be07 +bddc +bdb1 +bd86 +bd5b +bd30 +bd06 +bcdb +bcb0 +bc85 +bc5b +bc30 +bc05 +bbdb +bbb0 +bb86 +bb5b +bb31 +bb07 +badc +bab2 +ba88 +ba5d +ba33 +ba09 +b9df +b9b5 +b98b +b961 +b937 +b90d +b8e4 +b8ba +b890 +b866 +b83d +b813 +b7ea +b7c0 +b797 +b76d +b744 +b71b +b6f1 +b6c8 +b69f +b676 +b64c +b623 +b5fa +b5d1 +b5a8 +b580 +b557 +b52e +b505 +b4dc +b4b4 +b48b +b463 +b43a +b412 +b3e9 +b3c1 +b398 +b370 +b348 +b320 +b2f7 +b2cf +b2a7 +b27f +b257 +b22f +b207 +b1e0 +b1b8 +b190 +b168 +b141 +b119 +b0f2 +b0ca +b0a3 +b07b +b054 +b02c +b005 +afde +afb7 +af90 +af69 +af42 +af1b +aef4 +aecd +aea6 +ae7f +ae58 +ae32 +ae0b +ade5 +adbe +ad98 +ad71 +ad4b +ad24 +acfe +acd8 +acb2 +ac8c +ac65 +ac3f +ac19 +abf4 +abce +aba8 +ab82 +ab5c +ab37 +ab11 +aaeb +aac6 +aaa0 +aa7b +aa56 +aa30 +aa0b +a9e6 +a9c1 +a99c +a976 +a951 +a92d +a908 +a8e3 +a8be +a899 +a875 +a850 +a82b +a807 +a7e2 +a7be +a799 +a775 +a751 +a72d +a708 +a6e4 +a6c0 +a69c +a678 +a654 +a631 +a60d +a5e9 +a5c5 +a5a2 +a57e +a55b +a537 +a514 +a4f1 +a4cd +a4aa +a487 +a464 +a441 +a41e +a3fb +a3d8 +a3b5 +a392 +a36f +a34d +a32a +a307 +a2e5 +a2c2 +a2a0 +a27e +a25b +a239 +a217 +a1f5 +a1d3 +a1b1 +a18f +a16d +a14b +a129 +a108 +a0e6 +a0c4 +a0a3 +a081 +a060 +a03e +a01d +9ffc +9fdb +9fb9 +9f98 +9f77 +9f56 +9f35 +9f15 +9ef4 +9ed3 +9eb2 +9e92 +9e71 +9e51 +9e30 +9e10 +9def +9dcf +9daf +9d8f +9d6f +9d4f +9d2f +9d0f +9cef +9ccf +9caf +9c90 +9c70 +9c51 +9c31 +9c12 +9bf2 +9bd3 +9bb4 +9b94 +9b75 +9b56 +9b37 +9b18 +9af9 +9adb +9abc +9a9d +9a7e +9a60 +9a41 +9a23 +9a04 +99e6 +99c8 +99aa +998b +996d +994f +9931 +9913 +98f6 +98d8 +98ba +989c +987f +9861 +9844 +9826 +9809 +97ec +97ce +97b1 +9794 +9777 +975a +973d +9720 +9704 +96e7 +96ca +96ae +9691 +9675 +9658 +963c +9620 +9603 +95e7 +95cb +95af +9593 +9577 +955c +9540 +9524 +9508 +94ed +94d1 +94b6 +949b +947f +9464 +9449 +942e +9413 +93f8 +93dd +93c2 +93a7 +938c +9372 +9357 +933d +9322 +9308 +92ed +92d3 +92b9 +929f +9285 +926b +9251 +9237 +921d +9203 +91ea +91d0 +91b6 +919d +9184 +916a +9151 +9138 +911f +9105 +90ec +90d4 +90bb +90a2 +9089 +9070 +9058 +903f +9027 +900e +8ff6 +8fde +8fc6 +8fad +8f95 +8f7d +8f65 +8f4e +8f36 +8f1e +8f06 +8eef +8ed7 +8ec0 +8ea8 +8e91 +8e7a +8e63 +8e4c +8e35 +8e1e +8e07 +8df0 +8dd9 +8dc2 +8dac +8d95 +8d7f +8d68 +8d52 +8d3c +8d25 +8d0f +8cf9 +8ce3 +8ccd +8cb7 +8ca2 +8c8c +8c76 +8c61 +8c4b +8c36 +8c20 +8c0b +8bf6 +8be0 +8bcb +8bb6 +8ba1 +8b8c +8b78 +8b63 +8b4e +8b3a +8b25 +8b10 +8afc +8ae8 +8ad3 +8abf +8aab +8a97 +8a83 +8a6f +8a5b +8a48 +8a34 +8a20 +8a0d +89f9 +89e6 +89d3 +89bf +89ac +8999 +8986 +8973 +8960 +894d +893a +8928 +8915 +8902 +88f0 +88de +88cb +88b9 +88a7 +8895 +8883 +8871 +885f +884d +883b +8829 +8818 +8806 +87f5 +87e3 +87d2 +87c1 +87b0 +879e +878d +877c +876c +875b +874a +8739 +8729 +8718 +8708 +86f7 +86e7 +86d7 +86c7 +86b6 +86a6 +8696 +8687 +8677 +8667 +8657 +8648 +8638 +8629 +861a +860a +85fb +85ec +85dd +85ce +85bf +85b0 +85a1 +8593 +8584 +8575 +8567 +8558 +854a +853c +852e +8520 +8512 +8504 +84f6 +84e8 +84da +84cd +84bf +84b1 +84a4 +8497 +8489 +847c +846f +8462 +8455 +8448 +843b +842e +8422 +8415 +8408 +83fc +83f0 +83e3 +83d7 +83cb +83bf +83b3 +83a7 +839b +838f +8383 +8378 +836c +8361 +8355 +834a +833f +8333 +8328 +831d +8312 +8307 +82fc +82f2 +82e7 +82dc +82d2 +82c7 +82bd +82b3 +82a9 +829e +8294 +828a +8280 +8277 +826d +8263 +825a +8250 +8247 +823d +8234 +822b +8221 +8218 +820f +8206 +81fe +81f5 +81ec +81e3 +81db +81d2 +81ca +81c2 +81b9 +81b1 +81a9 +81a1 +8199 +8191 +8189 +8182 +817a +8173 +816b +8164 +815c +8155 +814e +8147 +8140 +8139 +8132 +812b +8124 +811e +8117 +8111 +810a +8104 +80fe +80f7 +80f1 +80eb +80e5 +80df +80da +80d4 +80ce +80c9 +80c3 +80be +80b8 +80b3 +80ae +80a9 +80a4 +809f +809a +8095 +8090 +808c +8087 +8083 +807e +807a +8076 +8071 +806d +8069 +8065 +8061 +805e +805a +8056 +8053 +804f +804c +8048 +8045 +8042 +803f +803c +8039 +8036 +8033 +8030 +802e +802b +8028 +8026 +8024 +8021 +801f +801d +801b +8019 +8017 +8015 +8014 +8012 +8010 +800f +800d +800c +800b +800a +8009 +8008 +8007 +8006 +8005 +8004 +8003 +8003 +8002 +8002 +8002 +8001 +8001 +8001 +8001 +8001 +8001 +8001 +8002 +8002 +8002 +8003 +8003 +8004 +8005 +8006 +8007 +8008 +8009 +800a +800b +800c +800d +800f +8010 +8012 +8014 +8015 +8017 +8019 +801b +801d +801f +8021 +8024 +8026 +8028 +802b +802e +8030 +8033 +8036 +8039 +803c +803f +8042 +8045 +8048 +804c +804f +8053 +8056 +805a +805e +8061 +8065 +8069 +806d +8071 +8076 +807a +807e +8083 +8087 +808c +8090 +8095 +809a +809f +80a4 +80a9 +80ae +80b3 +80b8 +80be +80c3 +80c9 +80ce +80d4 +80da +80df +80e5 +80eb +80f1 +80f7 +80fe +8104 +810a +8111 +8117 +811e +8124 +812b +8132 +8139 +8140 +8147 +814e +8155 +815c +8164 +816b +8173 +817a +8182 +8189 +8191 +8199 +81a1 +81a9 +81b1 +81b9 +81c2 +81ca +81d2 +81db +81e3 +81ec +81f5 +81fe +8206 +820f +8218 +8221 +822b +8234 +823d +8247 +8250 +825a +8263 +826d +8277 +8280 +828a +8294 +829e +82a9 +82b3 +82bd +82c7 +82d2 +82dc +82e7 +82f2 +82fc +8307 +8312 +831d +8328 +8333 +833f +834a +8355 +8361 +836c +8378 +8383 +838f +839b +83a7 +83b3 +83bf +83cb +83d7 +83e3 +83f0 +83fc +8408 +8415 +8422 +842e +843b +8448 +8455 +8462 +846f +847c +8489 +8497 +84a4 +84b1 +84bf +84cd +84da +84e8 +84f6 +8504 +8512 +8520 +852e +853c +854a +8558 +8567 +8575 +8584 +8593 +85a1 +85b0 +85bf +85ce +85dd +85ec +85fb +860a +861a +8629 +8638 +8648 +8657 +8667 +8677 +8687 +8696 +86a6 +86b6 +86c7 +86d7 +86e7 +86f7 +8708 +8718 +8729 +8739 +874a +875b +876c +877c +878d +879e +87b0 +87c1 +87d2 +87e3 +87f5 +8806 +8818 +8829 +883b +884d +885f +8871 +8883 +8895 +88a7 +88b9 +88cb +88de +88f0 +8902 +8915 +8928 +893a +894d +8960 +8973 +8986 +8999 +89ac +89bf +89d3 +89e6 +89f9 +8a0d +8a20 +8a34 +8a48 +8a5b +8a6f +8a83 +8a97 +8aab +8abf +8ad3 +8ae8 +8afc +8b10 +8b25 +8b3a +8b4e +8b63 +8b78 +8b8c +8ba1 +8bb6 +8bcb +8be0 +8bf6 +8c0b +8c20 +8c36 +8c4b +8c61 +8c76 +8c8c +8ca2 +8cb7 +8ccd +8ce3 +8cf9 +8d0f +8d25 +8d3c +8d52 +8d68 +8d7f +8d95 +8dac +8dc2 +8dd9 +8df0 +8e07 +8e1e +8e35 +8e4c +8e63 +8e7a +8e91 +8ea8 +8ec0 +8ed7 +8eef +8f06 +8f1e +8f36 +8f4e +8f65 +8f7d +8f95 +8fad +8fc6 +8fde +8ff6 +900e +9027 +903f +9058 +9070 +9089 +90a2 +90bb +90d4 +90ec +9105 +911f +9138 +9151 +916a +9184 +919d +91b6 +91d0 +91ea +9203 +921d +9237 +9251 +926b +9285 +929f +92b9 +92d3 +92ed +9308 +9322 +933d +9357 +9372 +938c +93a7 +93c2 +93dd +93f8 +9413 +942e +9449 +9464 +947f +949b +94b6 +94d1 +94ed +9508 +9524 +9540 +955c +9577 +9593 +95af +95cb +95e7 +9603 +9620 +963c +9658 +9675 +9691 +96ae +96ca +96e7 +9704 +9720 +973d +975a +9777 +9794 +97b1 +97ce +97ec +9809 +9826 +9844 +9861 +987f +989c +98ba +98d8 +98f6 +9913 +9931 +994f +996d +998b +99aa +99c8 +99e6 +9a04 +9a23 +9a41 +9a60 +9a7e +9a9d +9abc +9adb +9af9 +9b18 +9b37 +9b56 +9b75 +9b94 +9bb4 +9bd3 +9bf2 +9c12 +9c31 +9c51 +9c70 +9c90 +9caf +9ccf +9cef +9d0f +9d2f +9d4f +9d6f +9d8f +9daf +9dcf +9def +9e10 +9e30 +9e51 +9e71 +9e92 +9eb2 +9ed3 +9ef4 +9f15 +9f35 +9f56 +9f77 +9f98 +9fb9 +9fdb +9ffc +a01d +a03e +a060 +a081 +a0a3 +a0c4 +a0e6 +a108 +a129 +a14b +a16d +a18f +a1b1 +a1d3 +a1f5 +a217 +a239 +a25b +a27e +a2a0 +a2c2 +a2e5 +a307 +a32a +a34d +a36f +a392 +a3b5 +a3d8 +a3fb +a41e +a441 +a464 +a487 +a4aa +a4cd +a4f1 +a514 +a537 +a55b +a57e +a5a2 +a5c5 +a5e9 +a60d +a631 +a654 +a678 +a69c +a6c0 +a6e4 +a708 +a72d +a751 +a775 +a799 +a7be +a7e2 +a807 +a82b +a850 +a875 +a899 +a8be +a8e3 +a908 +a92d +a951 +a976 +a99c +a9c1 +a9e6 +aa0b +aa30 +aa56 +aa7b +aaa0 +aac6 +aaeb +ab11 +ab37 +ab5c +ab82 +aba8 +abce +abf4 +ac19 +ac3f +ac65 +ac8c +acb2 +acd8 +acfe +ad24 +ad4b +ad71 +ad98 +adbe +ade5 +ae0b +ae32 +ae58 +ae7f +aea6 +aecd +aef4 +af1b +af42 +af69 +af90 +afb7 +afde +b005 +b02c +b054 +b07b +b0a3 +b0ca +b0f2 +b119 +b141 +b168 +b190 +b1b8 +b1e0 +b207 +b22f +b257 +b27f +b2a7 +b2cf +b2f7 +b320 +b348 +b370 +b398 +b3c1 +b3e9 +b412 +b43a +b463 +b48b +b4b4 +b4dc +b505 +b52e +b557 +b580 +b5a8 +b5d1 +b5fa +b623 +b64c +b676 +b69f +b6c8 +b6f1 +b71b +b744 +b76d +b797 +b7c0 +b7ea +b813 +b83d +b866 +b890 +b8ba +b8e4 +b90d +b937 +b961 +b98b +b9b5 +b9df +ba09 +ba33 +ba5d +ba88 +bab2 +badc +bb07 +bb31 +bb5b +bb86 +bbb0 +bbdb +bc05 +bc30 +bc5b +bc85 +bcb0 +bcdb +bd06 +bd30 +bd5b +bd86 +bdb1 +bddc +be07 +be32 +be5e +be89 +beb4 +bedf +bf0a +bf36 +bf61 +bf8d +bfb8 +bfe3 +c00f +c03b +c066 +c092 +c0bd +c0e9 +c115 +c141 +c16d +c198 +c1c4 +c1f0 +c21c +c248 +c274 +c2a0 +c2cd +c2f9 +c325 +c351 +c37d +c3aa +c3d6 +c402 +c42f +c45b +c488 +c4b4 +c4e1 +c50e +c53a +c567 +c594 +c5c0 +c5ed +c61a +c647 +c674 +c6a0 +c6cd +c6fa +c727 +c755 +c782 +c7af +c7dc +c809 +c836 +c864 +c891 +c8be +c8eb +c919 +c946 +c974 +c9a1 +c9cf +c9fc +ca2a +ca58 +ca85 +cab3 +cae1 +cb0e +cb3c +cb6a +cb98 +cbc6 +cbf4 +cc21 +cc4f +cc7d +ccab +ccda +cd08 +cd36 +cd64 +cd92 +cdc0 +cdef +ce1d +ce4b +ce79 +cea8 +ced6 +cf05 +cf33 +cf62 +cf90 +cfbf +cfed +d01c +d04a +d079 +d0a8 +d0d6 +d105 +d134 +d163 +d192 +d1c0 +d1ef +d21e +d24d +d27c +d2ab +d2da +d309 +d338 +d367 +d396 +d3c6 +d3f5 +d424 +d453 +d483 +d4b2 +d4e1 +d510 +d540 +d56f +d59f +d5ce +d5fe +d62d +d65d +d68c +d6bc +d6eb +d71b +d74b +d77a +d7aa +d7da +d809 +d839 +d869 +d899 +d8c9 +d8f8 +d928 +d958 +d988 +d9b8 +d9e8 +da18 +da48 +da78 +daa8 +dad8 +db08 +db38 +db69 +db99 +dbc9 +dbf9 +dc29 +dc5a +dc8a +dcba +dceb +dd1b +dd4b +dd7c +ddac +dddd +de0d +de3e +de6e +de9f +decf +df00 +df30 +df61 +df91 +dfc2 +dff3 +e023 +e054 +e085 +e0b6 +e0e6 +e117 +e148 +e179 +e1a9 +e1da +e20b +e23c +e26d +e29e +e2cf +e300 +e331 +e362 +e393 +e3c4 +e3f5 +e426 +e457 +e488 +e4b9 +e4ea +e51b +e54c +e57e +e5af +e5e0 +e611 +e642 +e674 +e6a5 +e6d6 +e707 +e739 +e76a +e79b +e7cd +e7fe +e830 +e861 +e892 +e8c4 +e8f5 +e927 +e958 +e98a +e9bb +e9ed +ea1e +ea50 +ea81 +eab3 +eae4 +eb16 +eb47 +eb79 +ebab +ebdc +ec0e +ec40 +ec71 +eca3 +ecd5 +ed06 +ed38 +ed6a +ed9c +edcd +edff +ee31 +ee63 +ee94 +eec6 +eef8 +ef2a +ef5c +ef8e +efbf +eff1 +f023 +f055 +f087 +f0b9 +f0eb +f11d +f14f +f180 +f1b2 +f1e4 +f216 +f248 +f27a +f2ac +f2de +f310 +f342 +f374 +f3a6 +f3d8 +f40a +f43c +f46e +f4a1 +f4d3 +f505 +f537 +f569 +f59b +f5cd +f5ff +f631 +f663 +f696 +f6c8 +f6fa +f72c +f75e +f790 +f7c2 +f7f5 +f827 +f859 +f88b +f8bd +f8ef +f922 +f954 +f986 +f9b8 +f9ea +fa1d +fa4f +fa81 +fab3 +fae5 +fb18 +fb4a +fb7c +fbae +fbe1 +fc13 +fc45 +fc77 +fcaa +fcdc +fd0e +fd40 +fd73 +fda5 +fdd7 +fe09 +fe3c +fe6e +fea0 +fed2 +ff05 +ff37 +ff69 +ff9b +ffce +0000 +0032 +0065 +0097 +00c9 +00fb +012e +0160 +0192 +01c4 +01f7 +0229 +025b +028d +02c0 +02f2 +0324 +0356 +0389 +03bb +03ed +041f +0452 +0484 +04b6 +04e8 +051b +054d +057f +05b1 +05e3 +0616 +0648 +067a +06ac +06de +0711 +0743 +0775 +07a7 +07d9 +080b +083e +0870 +08a2 +08d4 +0906 +0938 +096a +099d +09cf +0a01 +0a33 +0a65 +0a97 +0ac9 +0afb +0b2d +0b5f +0b92 +0bc4 +0bf6 +0c28 +0c5a +0c8c +0cbe +0cf0 +0d22 +0d54 +0d86 +0db8 +0dea +0e1c +0e4e +0e80 +0eb1 +0ee3 +0f15 +0f47 +0f79 +0fab +0fdd +100f +1041 +1072 +10a4 +10d6 +1108 +113a +116c +119d +11cf +1201 +1233 +1264 +1296 +12c8 +12fa +132b +135d +138f +13c0 +13f2 +1424 +1455 +1487 +14b9 +14ea +151c +154d +157f +15b0 +15e2 +1613 +1645 +1676 +16a8 +16d9 +170b +173c +176e +179f +17d0 +1802 +1833 +1865 +1896 +18c7 +18f9 +192a +195b +198c +19be +19ef +1a20 +1a51 +1a82 +1ab4 +1ae5 +1b16 +1b47 +1b78 +1ba9 +1bda +1c0b +1c3c +1c6d +1c9e +1ccf +1d00 +1d31 +1d62 +1d93 +1dc4 +1df5 +1e26 +1e57 +1e87 +1eb8 +1ee9 +1f1a +1f4a +1f7b +1fac +1fdd +200d +203e +206f +209f +20d0 +2100 +2131 +2161 +2192 +21c2 +21f3 +2223 +2254 +2284 +22b5 +22e5 +2315 +2346 +2376 +23a6 +23d7 +2407 +2437 +2467 +2497 +24c8 +24f8 +2528 +2558 +2588 +25b8 +25e8 +2618 +2648 +2678 +26a8 +26d8 +2708 +2737 +2767 +2797 +27c7 +27f7 +2826 +2856 +2886 +28b5 +28e5 +2915 +2944 +2974 +29a3 +29d3 +2a02 +2a32 +2a61 +2a91 +2ac0 +2af0 +2b1f +2b4e +2b7d +2bad +2bdc +2c0b +2c3a +2c6a +2c99 +2cc8 +2cf7 +2d26 +2d55 +2d84 +2db3 +2de2 +2e11 +2e40 +2e6e +2e9d +2ecc +2efb +2f2a +2f58 +2f87 +2fb6 +2fe4 +3013 +3041 +3070 +309e +30cd +30fb +312a +3158 +3187 +31b5 +31e3 +3211 +3240 +326e +329c +32ca +32f8 +3326 +3355 +3383 +33b1 +33df +340c +343a +3468 +3496 +34c4 +34f2 +351f +354d +357b +35a8 +35d6 +3604 +3631 +365f +368c +36ba +36e7 +3715 +3742 +376f +379c +37ca +37f7 +3824 +3851 +387e +38ab +38d9 +3906 +3933 +3960 +398c +39b9 +39e6 +3a13 +3a40 +3a6c +3a99 +3ac6 +3af2 +3b1f +3b4c +3b78 +3ba5 +3bd1 +3bfe +3c2a +3c56 +3c83 +3caf +3cdb +3d07 +3d33 +3d60 +3d8c +3db8 +3de4 +3e10 +3e3c +3e68 +3e93 +3ebf +3eeb +3f17 +3f43 +3f6e +3f9a +3fc5 +3ff1 +401d +4048 +4073 +409f +40ca +40f6 +4121 +414c +4177 +41a2 +41ce +41f9 +4224 +424f +427a +42a5 +42d0 +42fa +4325 +4350 +437b +43a5 +43d0 +43fb +4425 +4450 +447a +44a5 +44cf +44f9 +4524 +454e +4578 +45a3 +45cd +45f7 +4621 +464b +4675 +469f +46c9 +46f3 +471c +4746 +4770 +479a +47c3 +47ed +4816 +4840 +4869 +4893 +48bc +48e5 +490f +4938 +4961 +498a +49b4 +49dd +4a06 +4a2f +4a58 +4a80 +4aa9 +4ad2 +4afb +4b24 +4b4c +4b75 +4b9d +4bc6 +4bee +4c17 +4c3f +4c68 +4c90 +4cb8 +4ce0 +4d09 +4d31 +4d59 +4d81 +4da9 +4dd1 +4df9 +4e20 +4e48 +4e70 +4e98 +4ebf +4ee7 +4f0e +4f36 +4f5d +4f85 +4fac +4fd4 +4ffb +5022 +5049 +5070 +5097 +50be +50e5 +510c +5133 +515a +5181 +51a8 +51ce +51f5 +521b +5242 +5268 +528f +52b5 +52dc +5302 +5328 +534e +5374 +539b +53c1 +53e7 +540c +5432 +5458 +547e +54a4 +54c9 +54ef +5515 +553a +5560 +5585 +55aa +55d0 +55f5 +561a +563f +5664 +568a +56af +56d3 +56f8 +571d +5742 +5767 +578b +57b0 +57d5 +57f9 +581e +5842 +5867 +588b +58af +58d3 +58f8 +591c +5940 +5964 +5988 +59ac +59cf +59f3 +5a17 +5a3b +5a5e +5a82 +5aa5 +5ac9 +5aec +5b0f +5b33 +5b56 +5b79 +5b9c +5bbf +5be2 +5c05 +5c28 +5c4b +5c6e +5c91 +5cb3 +5cd6 +5cf9 +5d1b +5d3e +5d60 +5d82 +5da5 +5dc7 +5de9 +5e0b +5e2d +5e4f +5e71 +5e93 +5eb5 +5ed7 +5ef8 +5f1a +5f3c +5f5d +5f7f +5fa0 +5fc2 +5fe3 +6004 +6025 +6047 +6068 +6089 +60aa +60cb +60eb +610c +612d +614e +616e +618f +61af +61d0 +61f0 +6211 +6231 +6251 +6271 +6291 +62b1 +62d1 +62f1 +6311 +6331 +6351 +6370 +6390 +63af +63cf +63ee +640e +642d +644c +646c +648b +64aa +64c9 +64e8 +6507 +6525 +6544 +6563 +6582 +65a0 +65bf +65dd +65fc +661a +6638 +6656 +6675 +6693 +66b1 +66cf +66ed +670a +6728 +6746 +6764 +6781 +679f +67bc +67da +67f7 +6814 +6832 +684f +686c +6889 +68a6 +68c3 +68e0 +68fc +6919 +6936 +6952 +696f +698b +69a8 +69c4 +69e0 +69fd +6a19 +6a35 +6a51 +6a6d +6a89 +6aa4 +6ac0 +6adc +6af8 +6b13 +6b2f +6b4a +6b65 +6b81 +6b9c +6bb7 +6bd2 +6bed +6c08 +6c23 +6c3e +6c59 +6c74 +6c8e +6ca9 +6cc3 +6cde +6cf8 +6d13 +6d2d +6d47 +6d61 +6d7b +6d95 +6daf +6dc9 +6de3 +6dfd +6e16 +6e30 +6e4a +6e63 +6e7c +6e96 +6eaf +6ec8 +6ee1 +6efb +6f14 +6f2c +6f45 +6f5e +6f77 +6f90 +6fa8 +6fc1 +6fd9 +6ff2 +700a +7022 +703a +7053 +706b +7083 +709b +70b2 +70ca +70e2 +70fa +7111 +7129 +7140 +7158 +716f +7186 +719d +71b4 +71cb +71e2 +71f9 +7210 +7227 +723e +7254 +726b +7281 +7298 +72ae +72c4 +72db +72f1 +7307 +731d +7333 +7349 +735e +7374 +738a +739f +73b5 +73ca +73e0 +73f5 +740a +7420 +7435 +744a +745f +7474 +7488 +749d +74b2 +74c6 +74db +74f0 +7504 +7518 +752d +7541 +7555 +7569 +757d +7591 +75a5 +75b8 +75cc +75e0 +75f3 +7607 +761a +762d +7641 +7654 +7667 +767a +768d +76a0 +76b3 +76c6 +76d8 +76eb +76fe +7710 +7722 +7735 +7747 +7759 +776b +777d +778f +77a1 +77b3 +77c5 +77d7 +77e8 +77fa +780b +781d +782e +783f +7850 +7862 +7873 +7884 +7894 +78a5 +78b6 +78c7 +78d7 +78e8 +78f8 +7909 +7919 +7929 +7939 +794a +795a +796a +7979 +7989 +7999 +79a9 +79b8 +79c8 +79d7 +79e6 +79f6 +7a05 +7a14 +7a23 +7a32 +7a41 +7a50 +7a5f +7a6d +7a7c +7a8b +7a99 +7aa8 +7ab6 +7ac4 +7ad2 +7ae0 +7aee +7afc +7b0a +7b18 +7b26 +7b33 +7b41 +7b4f +7b5c +7b69 +7b77 +7b84 +7b91 +7b9e +7bab +7bb8 +7bc5 +7bd2 +7bde +7beb +7bf8 +7c04 +7c10 +7c1d +7c29 +7c35 +7c41 +7c4d +7c59 +7c65 +7c71 +7c7d +7c88 +7c94 +7c9f +7cab +7cb6 +7cc1 +7ccd +7cd8 +7ce3 +7cee +7cf9 +7d04 +7d0e +7d19 +7d24 +7d2e +7d39 +7d43 +7d4d +7d57 +7d62 +7d6c +7d76 +7d80 +7d89 +7d93 +7d9d +7da6 +7db0 +7db9 +7dc3 +7dcc +7dd5 +7ddf +7de8 +7df1 +7dfa +7e02 +7e0b +7e14 +7e1d +7e25 +7e2e +7e36 +7e3e +7e47 +7e4f +7e57 +7e5f +7e67 +7e6f +7e77 +7e7e +7e86 +7e8d +7e95 +7e9c +7ea4 +7eab +7eb2 +7eb9 +7ec0 +7ec7 +7ece +7ed5 +7edc +7ee2 +7ee9 +7eef +7ef6 +7efc +7f02 +7f09 +7f0f +7f15 +7f1b +7f21 +7f26 +7f2c +7f32 +7f37 +7f3d +7f42 +7f48 +7f4d +7f52 +7f57 +7f5c +7f61 +7f66 +7f6b +7f70 +7f74 +7f79 +7f7d +7f82 +7f86 +7f8a +7f8f +7f93 +7f97 +7f9b +7f9f +7fa2 +7fa6 +7faa +7fad +7fb1 +7fb4 +7fb8 +7fbb +7fbe +7fc1 +7fc4 +7fc7 +7fca +7fcd +7fd0 +7fd2 +7fd5 +7fd8 +7fda +7fdc +7fdf +7fe1 +7fe3 +7fe5 +7fe7 +7fe9 +7feb +7fec +7fee +7ff0 +7ff1 +7ff3 +7ff4 +7ff5 +7ff6 +7ff7 +7ff8 +7ff9 +7ffa +7ffb +7ffc +7ffd +7ffd +7ffe +7ffe +7ffe +7fff +7fff +7fff diff --git a/mc/Advanced/DigitalUpDownConversion/design.v b/mc/Advanced/DigitalUpDownConversion/design.v new file mode 100644 index 0000000..7cbb880 --- /dev/null +++ b/mc/Advanced/DigitalUpDownConversion/design.v @@ -0,0 +1,707 @@ +// Combined DDC/DUC Instrument +// 16x interlaced design at 312.5 MHz clock (5 GS/s effective) +// +// Modes: +// DDC (Control3[0]=0): InputA -> Mixer -> 6-section IIR -> OutputA(I), OutputB(Q) +// DUC (Control3[0]=1): InputA(I)*cos - InputB(Q)*sin -> OutputA +// +// Pipeline Latency: +// DDC: 19 cycles (3 input + 3 NCO + 2 mixer + 12 IIR output) +// DUC: 8 cycles (3 input + 3 NCO + 2 mixer + 1 combine) + +/* verilator lint_off UNUSEDSIGNAL */ +/* verilator lint_off UNDRIVEN */ + +module CustomInstrumentInterlaced #( + parameter INPUT_INTERLACING_FACTOR = 16, + parameter OUTPUT_INTERLACING_FACTOR = 16 +) ( + input wire clk, + input wire reset, + input wire [31:0] sync, + + input wire signed [15:0] inputa [0:INPUT_INTERLACING_FACTOR-1], + input wire signed [15:0] inputb [0:INPUT_INTERLACING_FACTOR-1], + input wire signed [15:0] inputc [0:INPUT_INTERLACING_FACTOR-1], + input wire signed [15:0] inputd [0:INPUT_INTERLACING_FACTOR-1], + + input wire exttrig [0:INPUT_INTERLACING_FACTOR-1], + + output wire signed [15:0] outputa [0:OUTPUT_INTERLACING_FACTOR-1], + output wire signed [15:0] outputb [0:OUTPUT_INTERLACING_FACTOR-1], + output wire signed [15:0] outputc [0:OUTPUT_INTERLACING_FACTOR-1], + output wire signed [15:0] outputd [0:OUTPUT_INTERLACING_FACTOR-1], + + input wire [31:0] control [0:15], + output wire [31:0] status [0:15] +); + + // ======================================================================== + // Parameters and Constants + // ======================================================================== + localparam NUM_LANES = INPUT_INTERLACING_FACTOR; + localparam LUT_DEPTH = 4096; + localparam LUT_ADDR_BITS = 12; + localparam NUM_IIR_SECTIONS = 6; + + // Phase increment constant: K = round(2^64 / 5e9) = 3,689,348,815 + // phase_inc = (freq_hz * K) >> 32 + localparam [63:0] FREQ_TO_PHASE_K = 64'd3689348815; + + // ======================================================================== + // Type Definitions + // ======================================================================== + typedef logic signed [15:0] sample_t; + typedef logic signed [31:0] wide_t; + typedef logic signed [32:0] wider_t; + typedef logic [31:0] phase_t; + typedef logic [15:0] coeff_t; // Q0.16 unsigned coefficient + + // ======================================================================== + // Control Register Extraction + // ======================================================================== + wire [31:0] carrier_freq_hz = control[0]; + wire [31:0] cutoff_freq_hz = control[1]; + wire mode_select = control[3][0]; // 0=DDC, 1=DUC + + // ======================================================================== + // IO Boundary Registers + // ======================================================================== + sample_t inputa_io [0:NUM_LANES-1]; + sample_t inputb_io [0:NUM_LANES-1]; + + always_ff @(posedge clk) begin + if (reset) begin + for (int i = 0; i < NUM_LANES; i++) begin + inputa_io[i] <= '0; + inputb_io[i] <= '0; + end + end else begin + for (int i = 0; i < NUM_LANES; i++) begin + inputa_io[i] <= inputa[i]; + inputb_io[i] <= inputb[i]; + end + end + end + + // ======================================================================== + // Input Pipeline (3 stages: d1, d2, d3) + // ======================================================================== + sample_t input_d1_a [0:NUM_LANES-1]; + sample_t input_d1_b [0:NUM_LANES-1]; + sample_t input_d2_a [0:NUM_LANES-1]; + sample_t input_d2_b [0:NUM_LANES-1]; + sample_t input_d3_a [0:NUM_LANES-1]; + sample_t input_d3_b [0:NUM_LANES-1]; + + always_ff @(posedge clk) begin + if (reset) begin + for (int i = 0; i < NUM_LANES; i++) begin + input_d1_a[i] <= '0; + input_d1_b[i] <= '0; + input_d2_a[i] <= '0; + input_d2_b[i] <= '0; + input_d3_a[i] <= '0; + input_d3_b[i] <= '0; + end + end else begin + for (int i = 0; i < NUM_LANES; i++) begin + input_d1_a[i] <= inputa_io[i]; + input_d1_b[i] <= inputb_io[i]; + input_d2_a[i] <= input_d1_a[i]; + input_d2_b[i] <= input_d1_b[i]; + input_d3_a[i] <= input_d2_a[i]; + input_d3_b[i] <= input_d2_b[i]; + end + end + end + + // ======================================================================== + // Phase Increment Computation + // ======================================================================== + // phase_increment = (carrier_freq_hz * K) >> 32 + // This is computed combinationally and registered for use + logic [63:0] phase_inc_product; + phase_t phase_increment_r; + + always_comb begin + phase_inc_product = carrier_freq_hz * FREQ_TO_PHASE_K; + end + + always_ff @(posedge clk) begin + if (reset) begin + phase_increment_r <= '0; + end else begin + phase_increment_r <= phase_inc_product[63:32]; + end + end + + // ======================================================================== + // NCO Phase Accumulator + // ======================================================================== + phase_t phase_acc; + phase_t phase_acc_next; + + // Phase accumulator advances by phase_increment * NUM_LANES per clock + always_comb begin + phase_acc_next = phase_acc + (phase_increment_r * NUM_LANES); + end + + always_ff @(posedge clk) begin + if (reset) begin + phase_acc <= '0; + end else begin + phase_acc <= phase_acc_next; + end + end + + // ======================================================================== + // Per-Lane Phase Computation + // ======================================================================== + // lane_phase[g] = phase_acc + phase_increment * g + // Pre-compute increments for timing + phase_t lane_phase [0:NUM_LANES-1]; + phase_t phase_offset [0:NUM_LANES-1]; + + // Register the phase offsets (phase_increment * lane_index) + always_ff @(posedge clk) begin + if (reset) begin + for (int i = 0; i < NUM_LANES; i++) begin + phase_offset[i] <= '0; + end + end else begin + for (int i = 0; i < NUM_LANES; i++) begin + phase_offset[i] <= phase_increment_r * i[3:0]; + end + end + end + + // Compute per-lane phase combinationally from registered values + always_comb begin + for (int i = 0; i < NUM_LANES; i++) begin + lane_phase[i] = phase_acc + phase_offset[i]; + end + end + + // ======================================================================== + // NCO Sin/Cos LUT (16 replicated pairs for parallel access) + // ======================================================================== + // LUT address = phase[31:20] (top 12 bits) + sample_t sin_val [0:NUM_LANES-1]; + sample_t cos_val [0:NUM_LANES-1]; + sample_t sin_val_r [0:NUM_LANES-1]; + sample_t cos_val_r [0:NUM_LANES-1]; + + // Replicated sin/cos LUTs per lane with integrated read logic + genvar g; + generate + for (g = 0; g < NUM_LANES; g = g + 1) begin : NCO_LUT + (* ram_style = "block" *) sample_t sin_lut [0:LUT_DEPTH-1]; + (* ram_style = "block" *) sample_t cos_lut [0:LUT_DEPTH-1]; + + initial begin + $readmemh("sin_lut.mem", sin_lut); + $readmemh("cos_lut.mem", cos_lut); + end + + // LUT address for this lane + logic [LUT_ADDR_BITS-1:0] addr_comb; + logic [LUT_ADDR_BITS-1:0] addr_reg; + + // Combinational address from phase + always_comb begin + addr_comb = lane_phase[g][31:20]; + end + + // Stage 1: Register LUT address + always_ff @(posedge clk) begin + if (reset) begin + addr_reg <= '0; + end else begin + addr_reg <= addr_comb; + end + end + + // Stage 2: LUT read (BRAM output) + always_ff @(posedge clk) begin + if (reset) begin + sin_val[g] <= '0; + cos_val[g] <= '0; + end else begin + sin_val[g] <= sin_lut[addr_reg]; + cos_val[g] <= cos_lut[addr_reg]; + end + end + + // Stage 3: Pipeline register for NCO output + always_ff @(posedge clk) begin + if (reset) begin + sin_val_r[g] <= '0; + cos_val_r[g] <= '0; + end else begin + sin_val_r[g] <= sin_val[g]; + cos_val_r[g] <= cos_val[g]; + end + end + end + endgenerate + + // ======================================================================== + // External LO Mode Selection + // ======================================================================== + // When carrier_freq_hz = 0: + // DDC: Use InputB as cos, zero sin (external LO mode) + // DUC: cos(0)=32767, sin(0)=0 (bypass mode) + wire use_external_lo = (carrier_freq_hz == 32'd0); + + sample_t nco_cos [0:NUM_LANES-1]; + sample_t nco_sin [0:NUM_LANES-1]; + + always_comb begin + for (int i = 0; i < NUM_LANES; i++) begin + if (use_external_lo && !mode_select) begin + // DDC external LO mode: use InputB as cos, zero sin + nco_cos[i] = input_d3_b[i]; + nco_sin[i] = 16'sd0; + end else begin + // Normal NCO operation + nco_cos[i] = cos_val_r[i]; + nco_sin[i] = sin_val_r[i]; + end + end + end + + // ======================================================================== + // Mixer: 16x16 -> 32-bit multiply with Q1.15 normalization + // ======================================================================== + // DDC: I = InputA * cos, Q = InputA * (-sin) + // DUC: I_mix = InputA * cos, Q_mix = InputB * sin + + // Stage 1: Register mixer inputs (ensures DSP48 AREG/BREG absorption) + sample_t mixer_in_i [0:NUM_LANES-1]; + sample_t mixer_in_q [0:NUM_LANES-1]; + sample_t mixer_cos [0:NUM_LANES-1]; + sample_t mixer_sin [0:NUM_LANES-1]; + + always_ff @(posedge clk) begin + if (reset) begin + for (int i = 0; i < NUM_LANES; i++) begin + mixer_in_i[i] <= '0; + mixer_in_q[i] <= '0; + mixer_cos[i] <= '0; + mixer_sin[i] <= '0; + end + end else begin + for (int i = 0; i < NUM_LANES; i++) begin + if (mode_select) begin + // DUC mode: I input = InputA, Q input = InputB + mixer_in_i[i] <= input_d3_a[i]; + mixer_in_q[i] <= input_d3_b[i]; + end else begin + // DDC mode: Both paths use InputA + mixer_in_i[i] <= input_d3_a[i]; + mixer_in_q[i] <= input_d3_a[i]; + end + mixer_cos[i] <= nco_cos[i]; + mixer_sin[i] <= nco_sin[i]; + end + end + end + + // Stage 2: Multiply (DSP48 MREG) + wide_t mix_prod_i [0:NUM_LANES-1]; + wide_t mix_prod_q [0:NUM_LANES-1]; + + always_ff @(posedge clk) begin + if (reset) begin + for (int i = 0; i < NUM_LANES; i++) begin + mix_prod_i[i] <= '0; + mix_prod_q[i] <= '0; + end + end else begin + for (int i = 0; i < NUM_LANES; i++) begin + mix_prod_i[i] <= mixer_in_i[i] * mixer_cos[i]; + mix_prod_q[i] <= mixer_in_q[i] * mixer_sin[i]; + end + end + end + + // Stage 3: Scale (>>>15 with rounding) and saturate + // DDC Q path uses -sin, so negate the product + sample_t mix_out_i [0:NUM_LANES-1]; + sample_t mix_out_q [0:NUM_LANES-1]; + + // Saturation function + function automatic sample_t saturate_32to16(input wide_t val); + if (val > 32'sd32767) + return 16'sd32767; + else if (val < -32'sd32768) + return -16'sd32768; + else + return val[15:0]; + endfunction + + always_ff @(posedge clk) begin + if (reset) begin + for (int i = 0; i < NUM_LANES; i++) begin + mix_out_i[i] <= '0; + mix_out_q[i] <= '0; + end + end else begin + for (int i = 0; i < NUM_LANES; i++) begin + // I path: InputA * cos >>> 15 with rounding + wide_t i_rounded; + wide_t q_rounded; + wide_t q_negated; + + i_rounded = (mix_prod_i[i] + 32'sd16384) >>> 15; + mix_out_i[i] <= saturate_32to16(i_rounded); + + if (mode_select) begin + // DUC mode: Q = InputB * sin >>> 15 + q_rounded = (mix_prod_q[i] + 32'sd16384) >>> 15; + mix_out_q[i] <= saturate_32to16(q_rounded); + end else begin + // DDC mode: Q = InputA * (-sin) >>> 15 + // Negate the product before scaling + q_negated = -mix_prod_q[i]; + q_rounded = (q_negated + 32'sd16384) >>> 15; + mix_out_q[i] <= saturate_32to16(q_rounded); + end + end + end + end + + // ======================================================================== + // IIR Coefficient Computation + // ======================================================================== + // alpha_q16 = clamp(round(2*pi * f_cutoff * 65536 / 312,500,000), 0, 65535) + // Simplify: alpha_q16 = clamp(round(f_cutoff * 0.001319469), 0, 65535) + // Using integer math: alpha = (f_cutoff * 1319) >> 20 (approximation) + // More accurate: alpha = (f_cutoff * 2199023) >> 31 (matches 2*pi*65536/312.5e6) + + logic [51:0] alpha_product; + coeff_t alpha_q16; + logic [16:0] beta_q16; // 17-bit to hold 65536 + + // Constant: round(2 * pi * 65536 / 312500000 * 2^20) = 1382 + // Verification: For 1 MHz cutoff: (1000000 * 1382) >> 20 = 1318 + // For 10 MHz cutoff: (10000000 * 1382) >> 20 = 13179 + localparam [31:0] ALPHA_CONSTANT = 32'd1382; + + always_comb begin + alpha_product = cutoff_freq_hz * ALPHA_CONSTANT; + end + + always_ff @(posedge clk) begin + if (reset) begin + alpha_q16 <= '0; + beta_q16 <= 17'd65536; + end else begin + // alpha = (f_cutoff * K) >> 20, clamped to [0, 65535] + logic [31:0] alpha_raw; + alpha_raw = alpha_product[51:20]; + if (alpha_raw > 32'd65535) + alpha_q16 <= 16'd65535; + else + alpha_q16 <= alpha_raw[15:0]; + beta_q16 <= 17'd65536 - {1'b0, alpha_q16}; + end + end + + // ======================================================================== + // IIR Filter: 6-Section First-Order Cascade (per lane, I and Q) + // ======================================================================== + // Each section: y[n] = alpha*x[n] + beta*y[n-1] + // Q0.16 * Q1.15 = Q1.31, then >>16 to get Q1.15 + // 2-cycle pipeline per section: + // Cycle 1: products = alpha*x, beta*y_prev + // Cycle 2: sum = products, shift, saturate + + // IIR state arrays: [lane][section] + // dont_touch ensures state registers aren't optimized away or merged + (* dont_touch = "true" *) sample_t iir_state_i [0:NUM_LANES-1][0:NUM_IIR_SECTIONS-1]; + (* dont_touch = "true" *) sample_t iir_state_q [0:NUM_LANES-1][0:NUM_IIR_SECTIONS-1]; + + // Pipeline registers for IIR + // Section inputs + sample_t iir_in_i [0:NUM_LANES-1][0:NUM_IIR_SECTIONS-1]; + sample_t iir_in_q [0:NUM_LANES-1][0:NUM_IIR_SECTIONS-1]; + + // Products (stage 1 output) + // Alpha product: Q0.17 * Q1.15 = Q1.32 (max 33 bits) + // Beta product: Q0.18 * Q1.15 = Q1.33 (max 34 bits, beta can be 65536) + logic signed [33:0] iir_prod_alpha_i [0:NUM_LANES-1][0:NUM_IIR_SECTIONS-1]; + logic signed [33:0] iir_prod_alpha_q [0:NUM_LANES-1][0:NUM_IIR_SECTIONS-1]; + logic signed [33:0] iir_prod_beta_i [0:NUM_LANES-1][0:NUM_IIR_SECTIONS-1]; + logic signed [33:0] iir_prod_beta_q [0:NUM_LANES-1][0:NUM_IIR_SECTIONS-1]; + + // Section outputs (stage 2 output) + sample_t iir_out_i [0:NUM_LANES-1][0:NUM_IIR_SECTIONS-1]; + sample_t iir_out_q [0:NUM_LANES-1][0:NUM_IIR_SECTIONS-1]; + + // Coefficient registers (replicated per lane AND per section for reduced fanout) + // Each register feeds only 2 DSP multiply inputs (I and Q for one lane/section) + (* dont_touch = "true" *) coeff_t alpha_r [0:NUM_LANES-1][0:NUM_IIR_SECTIONS-1]; + (* dont_touch = "true" *) logic [16:0] beta_r [0:NUM_LANES-1][0:NUM_IIR_SECTIONS-1]; + + // Register coefficients for all lanes and sections + always_ff @(posedge clk) begin + if (reset) begin + for (int lane = 0; lane < NUM_LANES; lane++) begin + for (int s = 0; s < NUM_IIR_SECTIONS; s++) begin + alpha_r[lane][s] <= '0; + beta_r[lane][s] <= 17'd65536; + end + end + end else begin + for (int lane = 0; lane < NUM_LANES; lane++) begin + for (int s = 0; s < NUM_IIR_SECTIONS; s++) begin + alpha_r[lane][s] <= alpha_q16; + beta_r[lane][s] <= beta_q16; + end + end + end + end + + // Generate IIR filter chains for all lanes + generate + for (g = 0; g < NUM_LANES; g = g + 1) begin : IIR_LANE + + // Section 0 input comes from mixer output + always_ff @(posedge clk) begin + if (reset) begin + iir_in_i[g][0] <= '0; + iir_in_q[g][0] <= '0; + end else begin + iir_in_i[g][0] <= mix_out_i[g]; + iir_in_q[g][0] <= mix_out_q[g]; + end + end + + // Generate 6 sections + for (genvar s = 0; s < NUM_IIR_SECTIONS; s = s + 1) begin : IIR_SECTION + + // Initialize state on reset + initial begin + iir_state_i[g][s] = '0; + iir_state_q[g][s] = '0; + end + + // Stage 1: Compute products + always_ff @(posedge clk) begin + if (reset) begin + iir_prod_alpha_i[g][s] <= '0; + iir_prod_alpha_q[g][s] <= '0; + iir_prod_beta_i[g][s] <= '0; + iir_prod_beta_q[g][s] <= '0; + end else begin + // alpha * x (Q0.16 * Q1.15 = Q1.31) + // Use per-lane coefficients to reduce fanout + iir_prod_alpha_i[g][s] <= $signed({1'b0, alpha_r[g][s]}) * iir_in_i[g][s]; + iir_prod_alpha_q[g][s] <= $signed({1'b0, alpha_r[g][s]}) * iir_in_q[g][s]; + // beta * y_prev (Q0.17 * Q1.15 = Q1.32, but beta <= 65536) + iir_prod_beta_i[g][s] <= $signed({1'b0, beta_r[g][s]}) * iir_state_i[g][s]; + iir_prod_beta_q[g][s] <= $signed({1'b0, beta_r[g][s]}) * iir_state_q[g][s]; + end + end + + // Stage 2: Sum, shift (>>16), saturate + // Optimized for timing: narrower overflow detection, direct saturation + logic signed [34:0] sum_i_comb, sum_q_comb; + logic signed [18:0] scaled_i_comb, scaled_q_comb; // 19 bits after >>16 + sample_t sat_i_comb, sat_q_comb; + + always_comb begin + // Sum products with rounding + sum_i_comb = iir_prod_alpha_i[g][s] + iir_prod_beta_i[g][s] + 35'sd32768; + sum_q_comb = iir_prod_alpha_q[g][s] + iir_prod_beta_q[g][s] + 35'sd32768; + + // Extract 19-bit scaled result (sum[34:16]) + scaled_i_comb = sum_i_comb[34:16]; + scaled_q_comb = sum_q_comb[34:16]; + + // Optimized saturation: check only bits [18:15] for overflow + // If [18:15] are all 0s or all 1s, no overflow (value fits in 16-bit signed) + // Positive overflow: upper bits are 0001, 0010, 0011, ... 0111 (value > 32767) + // Negative overflow: upper bits are 1110, 1101, 1100, ... 1000 (value < -32768) + if (scaled_i_comb[18:15] == 4'b0000 || scaled_i_comb[18:15] == 4'b1111) + sat_i_comb = scaled_i_comb[15:0]; + else if (scaled_i_comb[18]) // Negative overflow + sat_i_comb = -16'sd32768; + else // Positive overflow + sat_i_comb = 16'sd32767; + + if (scaled_q_comb[18:15] == 4'b0000 || scaled_q_comb[18:15] == 4'b1111) + sat_q_comb = scaled_q_comb[15:0]; + else if (scaled_q_comb[18]) // Negative overflow + sat_q_comb = -16'sd32768; + else // Positive overflow + sat_q_comb = 16'sd32767; + end + + always_ff @(posedge clk) begin + if (reset) begin + iir_out_i[g][s] <= '0; + iir_out_q[g][s] <= '0; + iir_state_i[g][s] <= '0; + iir_state_q[g][s] <= '0; + end else begin + // Register the saturated values + iir_out_i[g][s] <= sat_i_comb; + iir_out_q[g][s] <= sat_q_comb; + + // Update state (feedback) - same value + iir_state_i[g][s] <= sat_i_comb; + iir_state_q[g][s] <= sat_q_comb; + end + end + + // Connect section output to next section input (except last) + if (s < NUM_IIR_SECTIONS - 1) begin : CHAIN + always_ff @(posedge clk) begin + if (reset) begin + iir_in_i[g][s+1] <= '0; + iir_in_q[g][s+1] <= '0; + end else begin + iir_in_i[g][s+1] <= iir_out_i[g][s]; + iir_in_q[g][s+1] <= iir_out_q[g][s]; + end + end + end + + end : IIR_SECTION + end : IIR_LANE + endgenerate + + // Final IIR output (last section output) + sample_t ddc_out_i [0:NUM_LANES-1]; + sample_t ddc_out_q [0:NUM_LANES-1]; + + always_comb begin + for (int i = 0; i < NUM_LANES; i++) begin + ddc_out_i[i] = iir_out_i[i][NUM_IIR_SECTIONS-1]; + ddc_out_q[i] = iir_out_q[i][NUM_IIR_SECTIONS-1]; + end + end + + // ======================================================================== + // DUC Combiner: (I*cos - Q*sin) >> 1 + // ======================================================================== + sample_t duc_out [0:NUM_LANES-1]; + + always_ff @(posedge clk) begin + if (reset) begin + for (int i = 0; i < NUM_LANES; i++) begin + duc_out[i] <= '0; + end + end else begin + for (int i = 0; i < NUM_LANES; i++) begin + // Subtract: I*cos - Q*sin (both already scaled by >>>15) + // Then >>1 for headroom + wide_t diff; + diff = $signed({{16{mix_out_i[i][15]}}, mix_out_i[i]}) - + $signed({{16{mix_out_q[i][15]}}, mix_out_q[i]}); + duc_out[i] <= diff[16:1]; // >>1 with truncation + end + end + end + + // ======================================================================== + // Output Multiplexer + // ======================================================================== + sample_t outa_r [0:NUM_LANES-1]; + sample_t outb_r [0:NUM_LANES-1]; + + // Pipeline the mode_select to match output timing + logic mode_select_d [0:19]; // Delay chain for mode select + + always_ff @(posedge clk) begin + if (reset) begin + for (int i = 0; i < 20; i++) begin + mode_select_d[i] <= 1'b0; + end + end else begin + mode_select_d[0] <= mode_select; + for (int i = 1; i < 20; i++) begin + mode_select_d[i] <= mode_select_d[i-1]; + end + end + end + + // Use delayed mode select for output mux (8 cycles for DUC path) + wire mode_at_output = mode_select_d[7]; + + always_ff @(posedge clk) begin + if (reset) begin + for (int i = 0; i < NUM_LANES; i++) begin + outa_r[i] <= '0; + outb_r[i] <= '0; + end + end else begin + for (int i = 0; i < NUM_LANES; i++) begin + if (mode_at_output) begin + // DUC mode: OutputA = DUC result, OutputB = 0 + outa_r[i] <= duc_out[i]; + outb_r[i] <= '0; + end else begin + // DDC mode: OutputA = I, OutputB = Q + outa_r[i] <= ddc_out_i[i]; + outb_r[i] <= ddc_out_q[i]; + end + end + end + end + + // ======================================================================== + // Output IO Registers and Assignments + // ======================================================================== + sample_t outa_io [0:NUM_LANES-1]; + sample_t outb_io [0:NUM_LANES-1]; + + always_ff @(posedge clk) begin + if (reset) begin + for (int i = 0; i < NUM_LANES; i++) begin + outa_io[i] <= '0; + outb_io[i] <= '0; + end + end else begin + for (int i = 0; i < NUM_LANES; i++) begin + outa_io[i] <= outa_r[i]; + outb_io[i] <= outb_r[i]; + end + end + end + + // Output wire assignments + genvar lane; + generate + for (lane = 0; lane < OUTPUT_INTERLACING_FACTOR; lane = lane + 1) begin : OUT_ASSIGN + assign outputa[lane] = outa_io[lane]; + assign outputb[lane] = outb_io[lane]; + assign outputc[lane] = 16'sd0; + assign outputd[lane] = 16'sd0; + end + endgenerate + + // ======================================================================== + // Status Registers + // ======================================================================== + assign status[0] = {16'd0, alpha_q16}; // Current IIR alpha_q16 + assign status[1] = 32'd0; // Reserved + assign status[2] = phase_increment_r; // Current NCO phase increment + assign status[3] = {31'd0, mode_select}; // Current mode + assign status[4] = 32'd0; + assign status[5] = 32'd0; + assign status[6] = 32'd0; + assign status[7] = 32'd0; + assign status[8] = 32'd0; + assign status[9] = 32'd0; + assign status[10] = 32'd0; + assign status[11] = 32'd0; + assign status[12] = 32'd0; + assign status[13] = 32'd0; + assign status[14] = 32'd0; + assign status[15] = 32'd0; + +endmodule diff --git a/mc/Advanced/DigitalUpDownConversion/sin_lut.mem b/mc/Advanced/DigitalUpDownConversion/sin_lut.mem new file mode 100644 index 0000000..f8d380c --- /dev/null +++ b/mc/Advanced/DigitalUpDownConversion/sin_lut.mem @@ -0,0 +1,4096 @@ +0000 +0032 +0065 +0097 +00c9 +00fb +012e +0160 +0192 +01c4 +01f7 +0229 +025b +028d +02c0 +02f2 +0324 +0356 +0389 +03bb +03ed +041f +0452 +0484 +04b6 +04e8 +051b +054d +057f +05b1 +05e3 +0616 +0648 +067a +06ac +06de +0711 +0743 +0775 +07a7 +07d9 +080b +083e +0870 +08a2 +08d4 +0906 +0938 +096a +099d +09cf +0a01 +0a33 +0a65 +0a97 +0ac9 +0afb +0b2d +0b5f +0b92 +0bc4 +0bf6 +0c28 +0c5a +0c8c +0cbe +0cf0 +0d22 +0d54 +0d86 +0db8 +0dea +0e1c +0e4e +0e80 +0eb1 +0ee3 +0f15 +0f47 +0f79 +0fab +0fdd +100f +1041 +1072 +10a4 +10d6 +1108 +113a +116c +119d +11cf +1201 +1233 +1264 +1296 +12c8 +12fa +132b +135d +138f +13c0 +13f2 +1424 +1455 +1487 +14b9 +14ea +151c +154d +157f +15b0 +15e2 +1613 +1645 +1676 +16a8 +16d9 +170b +173c +176e +179f +17d0 +1802 +1833 +1865 +1896 +18c7 +18f9 +192a +195b +198c +19be +19ef +1a20 +1a51 +1a82 +1ab4 +1ae5 +1b16 +1b47 +1b78 +1ba9 +1bda +1c0b +1c3c +1c6d +1c9e +1ccf +1d00 +1d31 +1d62 +1d93 +1dc4 +1df5 +1e26 +1e57 +1e87 +1eb8 +1ee9 +1f1a +1f4a +1f7b +1fac +1fdd +200d +203e +206f +209f +20d0 +2100 +2131 +2161 +2192 +21c2 +21f3 +2223 +2254 +2284 +22b5 +22e5 +2315 +2346 +2376 +23a6 +23d7 +2407 +2437 +2467 +2497 +24c8 +24f8 +2528 +2558 +2588 +25b8 +25e8 +2618 +2648 +2678 +26a8 +26d8 +2708 +2737 +2767 +2797 +27c7 +27f7 +2826 +2856 +2886 +28b5 +28e5 +2915 +2944 +2974 +29a3 +29d3 +2a02 +2a32 +2a61 +2a91 +2ac0 +2af0 +2b1f +2b4e +2b7d +2bad +2bdc +2c0b +2c3a +2c6a +2c99 +2cc8 +2cf7 +2d26 +2d55 +2d84 +2db3 +2de2 +2e11 +2e40 +2e6e +2e9d +2ecc +2efb +2f2a +2f58 +2f87 +2fb6 +2fe4 +3013 +3041 +3070 +309e +30cd +30fb +312a +3158 +3187 +31b5 +31e3 +3211 +3240 +326e +329c +32ca +32f8 +3326 +3355 +3383 +33b1 +33df +340c +343a +3468 +3496 +34c4 +34f2 +351f +354d +357b +35a8 +35d6 +3604 +3631 +365f +368c +36ba +36e7 +3715 +3742 +376f +379c +37ca +37f7 +3824 +3851 +387e +38ab +38d9 +3906 +3933 +3960 +398c +39b9 +39e6 +3a13 +3a40 +3a6c +3a99 +3ac6 +3af2 +3b1f +3b4c +3b78 +3ba5 +3bd1 +3bfe +3c2a +3c56 +3c83 +3caf +3cdb +3d07 +3d33 +3d60 +3d8c +3db8 +3de4 +3e10 +3e3c +3e68 +3e93 +3ebf +3eeb +3f17 +3f43 +3f6e +3f9a +3fc5 +3ff1 +401d +4048 +4073 +409f +40ca +40f6 +4121 +414c +4177 +41a2 +41ce +41f9 +4224 +424f +427a +42a5 +42d0 +42fa +4325 +4350 +437b +43a5 +43d0 +43fb +4425 +4450 +447a +44a5 +44cf +44f9 +4524 +454e +4578 +45a3 +45cd +45f7 +4621 +464b +4675 +469f +46c9 +46f3 +471c +4746 +4770 +479a +47c3 +47ed +4816 +4840 +4869 +4893 +48bc +48e5 +490f +4938 +4961 +498a +49b4 +49dd +4a06 +4a2f +4a58 +4a80 +4aa9 +4ad2 +4afb +4b24 +4b4c +4b75 +4b9d +4bc6 +4bee +4c17 +4c3f +4c68 +4c90 +4cb8 +4ce0 +4d09 +4d31 +4d59 +4d81 +4da9 +4dd1 +4df9 +4e20 +4e48 +4e70 +4e98 +4ebf +4ee7 +4f0e +4f36 +4f5d +4f85 +4fac +4fd4 +4ffb +5022 +5049 +5070 +5097 +50be +50e5 +510c +5133 +515a +5181 +51a8 +51ce +51f5 +521b +5242 +5268 +528f +52b5 +52dc +5302 +5328 +534e +5374 +539b +53c1 +53e7 +540c +5432 +5458 +547e +54a4 +54c9 +54ef +5515 +553a +5560 +5585 +55aa +55d0 +55f5 +561a +563f +5664 +568a +56af +56d3 +56f8 +571d +5742 +5767 +578b +57b0 +57d5 +57f9 +581e +5842 +5867 +588b +58af +58d3 +58f8 +591c +5940 +5964 +5988 +59ac +59cf +59f3 +5a17 +5a3b +5a5e +5a82 +5aa5 +5ac9 +5aec +5b0f +5b33 +5b56 +5b79 +5b9c +5bbf +5be2 +5c05 +5c28 +5c4b +5c6e +5c91 +5cb3 +5cd6 +5cf9 +5d1b +5d3e +5d60 +5d82 +5da5 +5dc7 +5de9 +5e0b +5e2d +5e4f +5e71 +5e93 +5eb5 +5ed7 +5ef8 +5f1a +5f3c +5f5d +5f7f +5fa0 +5fc2 +5fe3 +6004 +6025 +6047 +6068 +6089 +60aa +60cb +60eb +610c +612d +614e +616e +618f +61af +61d0 +61f0 +6211 +6231 +6251 +6271 +6291 +62b1 +62d1 +62f1 +6311 +6331 +6351 +6370 +6390 +63af +63cf +63ee +640e +642d +644c +646c +648b +64aa +64c9 +64e8 +6507 +6525 +6544 +6563 +6582 +65a0 +65bf +65dd +65fc +661a +6638 +6656 +6675 +6693 +66b1 +66cf +66ed +670a +6728 +6746 +6764 +6781 +679f +67bc +67da +67f7 +6814 +6832 +684f +686c +6889 +68a6 +68c3 +68e0 +68fc +6919 +6936 +6952 +696f +698b +69a8 +69c4 +69e0 +69fd +6a19 +6a35 +6a51 +6a6d +6a89 +6aa4 +6ac0 +6adc +6af8 +6b13 +6b2f +6b4a +6b65 +6b81 +6b9c +6bb7 +6bd2 +6bed +6c08 +6c23 +6c3e +6c59 +6c74 +6c8e +6ca9 +6cc3 +6cde +6cf8 +6d13 +6d2d +6d47 +6d61 +6d7b +6d95 +6daf +6dc9 +6de3 +6dfd +6e16 +6e30 +6e4a +6e63 +6e7c +6e96 +6eaf +6ec8 +6ee1 +6efb +6f14 +6f2c +6f45 +6f5e +6f77 +6f90 +6fa8 +6fc1 +6fd9 +6ff2 +700a +7022 +703a +7053 +706b +7083 +709b +70b2 +70ca +70e2 +70fa +7111 +7129 +7140 +7158 +716f +7186 +719d +71b4 +71cb +71e2 +71f9 +7210 +7227 +723e +7254 +726b +7281 +7298 +72ae +72c4 +72db +72f1 +7307 +731d +7333 +7349 +735e +7374 +738a +739f +73b5 +73ca +73e0 +73f5 +740a +7420 +7435 +744a +745f +7474 +7488 +749d +74b2 +74c6 +74db +74f0 +7504 +7518 +752d +7541 +7555 +7569 +757d +7591 +75a5 +75b8 +75cc +75e0 +75f3 +7607 +761a +762d +7641 +7654 +7667 +767a +768d +76a0 +76b3 +76c6 +76d8 +76eb +76fe +7710 +7722 +7735 +7747 +7759 +776b +777d +778f +77a1 +77b3 +77c5 +77d7 +77e8 +77fa +780b +781d +782e +783f +7850 +7862 +7873 +7884 +7894 +78a5 +78b6 +78c7 +78d7 +78e8 +78f8 +7909 +7919 +7929 +7939 +794a +795a +796a +7979 +7989 +7999 +79a9 +79b8 +79c8 +79d7 +79e6 +79f6 +7a05 +7a14 +7a23 +7a32 +7a41 +7a50 +7a5f +7a6d +7a7c +7a8b +7a99 +7aa8 +7ab6 +7ac4 +7ad2 +7ae0 +7aee +7afc +7b0a +7b18 +7b26 +7b33 +7b41 +7b4f +7b5c +7b69 +7b77 +7b84 +7b91 +7b9e +7bab +7bb8 +7bc5 +7bd2 +7bde +7beb +7bf8 +7c04 +7c10 +7c1d +7c29 +7c35 +7c41 +7c4d +7c59 +7c65 +7c71 +7c7d +7c88 +7c94 +7c9f +7cab +7cb6 +7cc1 +7ccd +7cd8 +7ce3 +7cee +7cf9 +7d04 +7d0e +7d19 +7d24 +7d2e +7d39 +7d43 +7d4d +7d57 +7d62 +7d6c +7d76 +7d80 +7d89 +7d93 +7d9d +7da6 +7db0 +7db9 +7dc3 +7dcc +7dd5 +7ddf +7de8 +7df1 +7dfa +7e02 +7e0b +7e14 +7e1d +7e25 +7e2e +7e36 +7e3e +7e47 +7e4f +7e57 +7e5f +7e67 +7e6f +7e77 +7e7e +7e86 +7e8d +7e95 +7e9c +7ea4 +7eab +7eb2 +7eb9 +7ec0 +7ec7 +7ece +7ed5 +7edc +7ee2 +7ee9 +7eef +7ef6 +7efc +7f02 +7f09 +7f0f +7f15 +7f1b +7f21 +7f26 +7f2c +7f32 +7f37 +7f3d +7f42 +7f48 +7f4d +7f52 +7f57 +7f5c +7f61 +7f66 +7f6b +7f70 +7f74 +7f79 +7f7d +7f82 +7f86 +7f8a +7f8f +7f93 +7f97 +7f9b +7f9f +7fa2 +7fa6 +7faa +7fad +7fb1 +7fb4 +7fb8 +7fbb +7fbe +7fc1 +7fc4 +7fc7 +7fca +7fcd +7fd0 +7fd2 +7fd5 +7fd8 +7fda +7fdc +7fdf +7fe1 +7fe3 +7fe5 +7fe7 +7fe9 +7feb +7fec +7fee +7ff0 +7ff1 +7ff3 +7ff4 +7ff5 +7ff6 +7ff7 +7ff8 +7ff9 +7ffa +7ffb +7ffc +7ffd +7ffd +7ffe +7ffe +7ffe +7fff +7fff +7fff +7fff +7fff +7fff +7fff +7ffe +7ffe +7ffe +7ffd +7ffd +7ffc +7ffb +7ffa +7ff9 +7ff8 +7ff7 +7ff6 +7ff5 +7ff4 +7ff3 +7ff1 +7ff0 +7fee +7fec +7feb +7fe9 +7fe7 +7fe5 +7fe3 +7fe1 +7fdf +7fdc +7fda +7fd8 +7fd5 +7fd2 +7fd0 +7fcd +7fca +7fc7 +7fc4 +7fc1 +7fbe +7fbb +7fb8 +7fb4 +7fb1 +7fad +7faa +7fa6 +7fa2 +7f9f +7f9b +7f97 +7f93 +7f8f +7f8a +7f86 +7f82 +7f7d +7f79 +7f74 +7f70 +7f6b +7f66 +7f61 +7f5c +7f57 +7f52 +7f4d +7f48 +7f42 +7f3d +7f37 +7f32 +7f2c +7f26 +7f21 +7f1b +7f15 +7f0f +7f09 +7f02 +7efc +7ef6 +7eef +7ee9 +7ee2 +7edc +7ed5 +7ece +7ec7 +7ec0 +7eb9 +7eb2 +7eab +7ea4 +7e9c +7e95 +7e8d +7e86 +7e7e +7e77 +7e6f +7e67 +7e5f +7e57 +7e4f +7e47 +7e3e +7e36 +7e2e +7e25 +7e1d +7e14 +7e0b +7e02 +7dfa +7df1 +7de8 +7ddf +7dd5 +7dcc +7dc3 +7db9 +7db0 +7da6 +7d9d +7d93 +7d89 +7d80 +7d76 +7d6c +7d62 +7d57 +7d4d +7d43 +7d39 +7d2e +7d24 +7d19 +7d0e +7d04 +7cf9 +7cee +7ce3 +7cd8 +7ccd +7cc1 +7cb6 +7cab +7c9f +7c94 +7c88 +7c7d +7c71 +7c65 +7c59 +7c4d +7c41 +7c35 +7c29 +7c1d +7c10 +7c04 +7bf8 +7beb +7bde +7bd2 +7bc5 +7bb8 +7bab +7b9e +7b91 +7b84 +7b77 +7b69 +7b5c +7b4f +7b41 +7b33 +7b26 +7b18 +7b0a +7afc +7aee +7ae0 +7ad2 +7ac4 +7ab6 +7aa8 +7a99 +7a8b +7a7c +7a6d +7a5f +7a50 +7a41 +7a32 +7a23 +7a14 +7a05 +79f6 +79e6 +79d7 +79c8 +79b8 +79a9 +7999 +7989 +7979 +796a +795a +794a +7939 +7929 +7919 +7909 +78f8 +78e8 +78d7 +78c7 +78b6 +78a5 +7894 +7884 +7873 +7862 +7850 +783f +782e +781d +780b +77fa +77e8 +77d7 +77c5 +77b3 +77a1 +778f +777d +776b +7759 +7747 +7735 +7722 +7710 +76fe +76eb +76d8 +76c6 +76b3 +76a0 +768d +767a +7667 +7654 +7641 +762d +761a +7607 +75f3 +75e0 +75cc +75b8 +75a5 +7591 +757d +7569 +7555 +7541 +752d +7518 +7504 +74f0 +74db +74c6 +74b2 +749d +7488 +7474 +745f +744a +7435 +7420 +740a +73f5 +73e0 +73ca +73b5 +739f +738a +7374 +735e +7349 +7333 +731d +7307 +72f1 +72db +72c4 +72ae +7298 +7281 +726b +7254 +723e +7227 +7210 +71f9 +71e2 +71cb +71b4 +719d +7186 +716f +7158 +7140 +7129 +7111 +70fa +70e2 +70ca +70b2 +709b +7083 +706b +7053 +703a +7022 +700a +6ff2 +6fd9 +6fc1 +6fa8 +6f90 +6f77 +6f5e +6f45 +6f2c +6f14 +6efb +6ee1 +6ec8 +6eaf +6e96 +6e7c +6e63 +6e4a +6e30 +6e16 +6dfd +6de3 +6dc9 +6daf +6d95 +6d7b +6d61 +6d47 +6d2d +6d13 +6cf8 +6cde +6cc3 +6ca9 +6c8e +6c74 +6c59 +6c3e +6c23 +6c08 +6bed +6bd2 +6bb7 +6b9c +6b81 +6b65 +6b4a +6b2f +6b13 +6af8 +6adc +6ac0 +6aa4 +6a89 +6a6d +6a51 +6a35 +6a19 +69fd +69e0 +69c4 +69a8 +698b +696f +6952 +6936 +6919 +68fc +68e0 +68c3 +68a6 +6889 +686c +684f +6832 +6814 +67f7 +67da +67bc +679f +6781 +6764 +6746 +6728 +670a +66ed +66cf +66b1 +6693 +6675 +6656 +6638 +661a +65fc +65dd +65bf +65a0 +6582 +6563 +6544 +6525 +6507 +64e8 +64c9 +64aa +648b +646c +644c +642d +640e +63ee +63cf +63af +6390 +6370 +6351 +6331 +6311 +62f1 +62d1 +62b1 +6291 +6271 +6251 +6231 +6211 +61f0 +61d0 +61af +618f +616e +614e +612d +610c +60eb +60cb +60aa +6089 +6068 +6047 +6025 +6004 +5fe3 +5fc2 +5fa0 +5f7f +5f5d +5f3c +5f1a +5ef8 +5ed7 +5eb5 +5e93 +5e71 +5e4f +5e2d +5e0b +5de9 +5dc7 +5da5 +5d82 +5d60 +5d3e +5d1b +5cf9 +5cd6 +5cb3 +5c91 +5c6e +5c4b +5c28 +5c05 +5be2 +5bbf +5b9c +5b79 +5b56 +5b33 +5b0f +5aec +5ac9 +5aa5 +5a82 +5a5e +5a3b +5a17 +59f3 +59cf +59ac +5988 +5964 +5940 +591c +58f8 +58d3 +58af +588b +5867 +5842 +581e +57f9 +57d5 +57b0 +578b +5767 +5742 +571d +56f8 +56d3 +56af +568a +5664 +563f +561a +55f5 +55d0 +55aa +5585 +5560 +553a +5515 +54ef +54c9 +54a4 +547e +5458 +5432 +540c +53e7 +53c1 +539b +5374 +534e +5328 +5302 +52dc +52b5 +528f +5268 +5242 +521b +51f5 +51ce +51a8 +5181 +515a +5133 +510c +50e5 +50be +5097 +5070 +5049 +5022 +4ffb +4fd4 +4fac +4f85 +4f5d +4f36 +4f0e +4ee7 +4ebf +4e98 +4e70 +4e48 +4e20 +4df9 +4dd1 +4da9 +4d81 +4d59 +4d31 +4d09 +4ce0 +4cb8 +4c90 +4c68 +4c3f +4c17 +4bee +4bc6 +4b9d +4b75 +4b4c +4b24 +4afb +4ad2 +4aa9 +4a80 +4a58 +4a2f +4a06 +49dd +49b4 +498a +4961 +4938 +490f +48e5 +48bc +4893 +4869 +4840 +4816 +47ed +47c3 +479a +4770 +4746 +471c +46f3 +46c9 +469f +4675 +464b +4621 +45f7 +45cd +45a3 +4578 +454e +4524 +44f9 +44cf +44a5 +447a +4450 +4425 +43fb +43d0 +43a5 +437b +4350 +4325 +42fa +42d0 +42a5 +427a +424f +4224 +41f9 +41ce +41a2 +4177 +414c +4121 +40f6 +40ca +409f +4073 +4048 +401d +3ff1 +3fc5 +3f9a +3f6e +3f43 +3f17 +3eeb +3ebf +3e93 +3e68 +3e3c +3e10 +3de4 +3db8 +3d8c +3d60 +3d33 +3d07 +3cdb +3caf +3c83 +3c56 +3c2a +3bfe +3bd1 +3ba5 +3b78 +3b4c +3b1f +3af2 +3ac6 +3a99 +3a6c +3a40 +3a13 +39e6 +39b9 +398c +3960 +3933 +3906 +38d9 +38ab +387e +3851 +3824 +37f7 +37ca +379c +376f +3742 +3715 +36e7 +36ba +368c +365f +3631 +3604 +35d6 +35a8 +357b +354d +351f +34f2 +34c4 +3496 +3468 +343a +340c +33df +33b1 +3383 +3355 +3326 +32f8 +32ca +329c +326e +3240 +3211 +31e3 +31b5 +3187 +3158 +312a +30fb +30cd +309e +3070 +3041 +3013 +2fe4 +2fb6 +2f87 +2f58 +2f2a +2efb +2ecc +2e9d +2e6e +2e40 +2e11 +2de2 +2db3 +2d84 +2d55 +2d26 +2cf7 +2cc8 +2c99 +2c6a +2c3a +2c0b +2bdc +2bad +2b7d +2b4e +2b1f +2af0 +2ac0 +2a91 +2a61 +2a32 +2a02 +29d3 +29a3 +2974 +2944 +2915 +28e5 +28b5 +2886 +2856 +2826 +27f7 +27c7 +2797 +2767 +2737 +2708 +26d8 +26a8 +2678 +2648 +2618 +25e8 +25b8 +2588 +2558 +2528 +24f8 +24c8 +2497 +2467 +2437 +2407 +23d7 +23a6 +2376 +2346 +2315 +22e5 +22b5 +2284 +2254 +2223 +21f3 +21c2 +2192 +2161 +2131 +2100 +20d0 +209f +206f +203e +200d +1fdd +1fac +1f7b +1f4a +1f1a +1ee9 +1eb8 +1e87 +1e57 +1e26 +1df5 +1dc4 +1d93 +1d62 +1d31 +1d00 +1ccf +1c9e +1c6d +1c3c +1c0b +1bda +1ba9 +1b78 +1b47 +1b16 +1ae5 +1ab4 +1a82 +1a51 +1a20 +19ef +19be +198c +195b +192a +18f9 +18c7 +1896 +1865 +1833 +1802 +17d0 +179f +176e +173c +170b +16d9 +16a8 +1676 +1645 +1613 +15e2 +15b0 +157f +154d +151c +14ea +14b9 +1487 +1455 +1424 +13f2 +13c0 +138f +135d +132b +12fa +12c8 +1296 +1264 +1233 +1201 +11cf +119d +116c +113a +1108 +10d6 +10a4 +1072 +1041 +100f +0fdd +0fab +0f79 +0f47 +0f15 +0ee3 +0eb1 +0e80 +0e4e +0e1c +0dea +0db8 +0d86 +0d54 +0d22 +0cf0 +0cbe +0c8c +0c5a +0c28 +0bf6 +0bc4 +0b92 +0b5f +0b2d +0afb +0ac9 +0a97 +0a65 +0a33 +0a01 +09cf +099d +096a +0938 +0906 +08d4 +08a2 +0870 +083e +080b +07d9 +07a7 +0775 +0743 +0711 +06de +06ac +067a +0648 +0616 +05e3 +05b1 +057f +054d +051b +04e8 +04b6 +0484 +0452 +041f +03ed +03bb +0389 +0356 +0324 +02f2 +02c0 +028d +025b +0229 +01f7 +01c4 +0192 +0160 +012e +00fb +00c9 +0097 +0065 +0032 +0000 +ffce +ff9b +ff69 +ff37 +ff05 +fed2 +fea0 +fe6e +fe3c +fe09 +fdd7 +fda5 +fd73 +fd40 +fd0e +fcdc +fcaa +fc77 +fc45 +fc13 +fbe1 +fbae +fb7c +fb4a +fb18 +fae5 +fab3 +fa81 +fa4f +fa1d +f9ea +f9b8 +f986 +f954 +f922 +f8ef +f8bd +f88b +f859 +f827 +f7f5 +f7c2 +f790 +f75e +f72c +f6fa +f6c8 +f696 +f663 +f631 +f5ff +f5cd +f59b +f569 +f537 +f505 +f4d3 +f4a1 +f46e +f43c +f40a +f3d8 +f3a6 +f374 +f342 +f310 +f2de +f2ac +f27a +f248 +f216 +f1e4 +f1b2 +f180 +f14f +f11d +f0eb +f0b9 +f087 +f055 +f023 +eff1 +efbf +ef8e +ef5c +ef2a +eef8 +eec6 +ee94 +ee63 +ee31 +edff +edcd +ed9c +ed6a +ed38 +ed06 +ecd5 +eca3 +ec71 +ec40 +ec0e +ebdc +ebab +eb79 +eb47 +eb16 +eae4 +eab3 +ea81 +ea50 +ea1e +e9ed +e9bb +e98a +e958 +e927 +e8f5 +e8c4 +e892 +e861 +e830 +e7fe +e7cd +e79b +e76a +e739 +e707 +e6d6 +e6a5 +e674 +e642 +e611 +e5e0 +e5af +e57e +e54c +e51b +e4ea +e4b9 +e488 +e457 +e426 +e3f5 +e3c4 +e393 +e362 +e331 +e300 +e2cf +e29e +e26d +e23c +e20b +e1da +e1a9 +e179 +e148 +e117 +e0e6 +e0b6 +e085 +e054 +e023 +dff3 +dfc2 +df91 +df61 +df30 +df00 +decf +de9f +de6e +de3e +de0d +dddd +ddac +dd7c +dd4b +dd1b +dceb +dcba +dc8a +dc5a +dc29 +dbf9 +dbc9 +db99 +db69 +db38 +db08 +dad8 +daa8 +da78 +da48 +da18 +d9e8 +d9b8 +d988 +d958 +d928 +d8f8 +d8c9 +d899 +d869 +d839 +d809 +d7da +d7aa +d77a +d74b +d71b +d6eb +d6bc +d68c +d65d +d62d +d5fe +d5ce +d59f +d56f +d540 +d510 +d4e1 +d4b2 +d483 +d453 +d424 +d3f5 +d3c6 +d396 +d367 +d338 +d309 +d2da +d2ab +d27c +d24d +d21e +d1ef +d1c0 +d192 +d163 +d134 +d105 +d0d6 +d0a8 +d079 +d04a +d01c +cfed +cfbf +cf90 +cf62 +cf33 +cf05 +ced6 +cea8 +ce79 +ce4b +ce1d +cdef +cdc0 +cd92 +cd64 +cd36 +cd08 +ccda +ccab +cc7d +cc4f +cc21 +cbf4 +cbc6 +cb98 +cb6a +cb3c +cb0e +cae1 +cab3 +ca85 +ca58 +ca2a +c9fc +c9cf +c9a1 +c974 +c946 +c919 +c8eb +c8be +c891 +c864 +c836 +c809 +c7dc +c7af +c782 +c755 +c727 +c6fa +c6cd +c6a0 +c674 +c647 +c61a +c5ed +c5c0 +c594 +c567 +c53a +c50e +c4e1 +c4b4 +c488 +c45b +c42f +c402 +c3d6 +c3aa +c37d +c351 +c325 +c2f9 +c2cd +c2a0 +c274 +c248 +c21c +c1f0 +c1c4 +c198 +c16d +c141 +c115 +c0e9 +c0bd +c092 +c066 +c03b +c00f +bfe3 +bfb8 +bf8d +bf61 +bf36 +bf0a +bedf +beb4 +be89 +be5e +be32 +be07 +bddc +bdb1 +bd86 +bd5b +bd30 +bd06 +bcdb +bcb0 +bc85 +bc5b +bc30 +bc05 +bbdb +bbb0 +bb86 +bb5b +bb31 +bb07 +badc +bab2 +ba88 +ba5d +ba33 +ba09 +b9df +b9b5 +b98b +b961 +b937 +b90d +b8e4 +b8ba +b890 +b866 +b83d +b813 +b7ea +b7c0 +b797 +b76d +b744 +b71b +b6f1 +b6c8 +b69f +b676 +b64c +b623 +b5fa +b5d1 +b5a8 +b580 +b557 +b52e +b505 +b4dc +b4b4 +b48b +b463 +b43a +b412 +b3e9 +b3c1 +b398 +b370 +b348 +b320 +b2f7 +b2cf +b2a7 +b27f +b257 +b22f +b207 +b1e0 +b1b8 +b190 +b168 +b141 +b119 +b0f2 +b0ca +b0a3 +b07b +b054 +b02c +b005 +afde +afb7 +af90 +af69 +af42 +af1b +aef4 +aecd +aea6 +ae7f +ae58 +ae32 +ae0b +ade5 +adbe +ad98 +ad71 +ad4b +ad24 +acfe +acd8 +acb2 +ac8c +ac65 +ac3f +ac19 +abf4 +abce +aba8 +ab82 +ab5c +ab37 +ab11 +aaeb +aac6 +aaa0 +aa7b +aa56 +aa30 +aa0b +a9e6 +a9c1 +a99c +a976 +a951 +a92d +a908 +a8e3 +a8be +a899 +a875 +a850 +a82b +a807 +a7e2 +a7be +a799 +a775 +a751 +a72d +a708 +a6e4 +a6c0 +a69c +a678 +a654 +a631 +a60d +a5e9 +a5c5 +a5a2 +a57e +a55b +a537 +a514 +a4f1 +a4cd +a4aa +a487 +a464 +a441 +a41e +a3fb +a3d8 +a3b5 +a392 +a36f +a34d +a32a +a307 +a2e5 +a2c2 +a2a0 +a27e +a25b +a239 +a217 +a1f5 +a1d3 +a1b1 +a18f +a16d +a14b +a129 +a108 +a0e6 +a0c4 +a0a3 +a081 +a060 +a03e +a01d +9ffc +9fdb +9fb9 +9f98 +9f77 +9f56 +9f35 +9f15 +9ef4 +9ed3 +9eb2 +9e92 +9e71 +9e51 +9e30 +9e10 +9def +9dcf +9daf +9d8f +9d6f +9d4f +9d2f +9d0f +9cef +9ccf +9caf +9c90 +9c70 +9c51 +9c31 +9c12 +9bf2 +9bd3 +9bb4 +9b94 +9b75 +9b56 +9b37 +9b18 +9af9 +9adb +9abc +9a9d +9a7e +9a60 +9a41 +9a23 +9a04 +99e6 +99c8 +99aa +998b +996d +994f +9931 +9913 +98f6 +98d8 +98ba +989c +987f +9861 +9844 +9826 +9809 +97ec +97ce +97b1 +9794 +9777 +975a +973d +9720 +9704 +96e7 +96ca +96ae +9691 +9675 +9658 +963c +9620 +9603 +95e7 +95cb +95af +9593 +9577 +955c +9540 +9524 +9508 +94ed +94d1 +94b6 +949b +947f +9464 +9449 +942e +9413 +93f8 +93dd +93c2 +93a7 +938c +9372 +9357 +933d +9322 +9308 +92ed +92d3 +92b9 +929f +9285 +926b +9251 +9237 +921d +9203 +91ea +91d0 +91b6 +919d +9184 +916a +9151 +9138 +911f +9105 +90ec +90d4 +90bb +90a2 +9089 +9070 +9058 +903f +9027 +900e +8ff6 +8fde +8fc6 +8fad +8f95 +8f7d +8f65 +8f4e +8f36 +8f1e +8f06 +8eef +8ed7 +8ec0 +8ea8 +8e91 +8e7a +8e63 +8e4c +8e35 +8e1e +8e07 +8df0 +8dd9 +8dc2 +8dac +8d95 +8d7f +8d68 +8d52 +8d3c +8d25 +8d0f +8cf9 +8ce3 +8ccd +8cb7 +8ca2 +8c8c +8c76 +8c61 +8c4b +8c36 +8c20 +8c0b +8bf6 +8be0 +8bcb +8bb6 +8ba1 +8b8c +8b78 +8b63 +8b4e +8b3a +8b25 +8b10 +8afc +8ae8 +8ad3 +8abf +8aab +8a97 +8a83 +8a6f +8a5b +8a48 +8a34 +8a20 +8a0d +89f9 +89e6 +89d3 +89bf +89ac +8999 +8986 +8973 +8960 +894d +893a +8928 +8915 +8902 +88f0 +88de +88cb +88b9 +88a7 +8895 +8883 +8871 +885f +884d +883b +8829 +8818 +8806 +87f5 +87e3 +87d2 +87c1 +87b0 +879e +878d +877c +876c +875b +874a +8739 +8729 +8718 +8708 +86f7 +86e7 +86d7 +86c7 +86b6 +86a6 +8696 +8687 +8677 +8667 +8657 +8648 +8638 +8629 +861a +860a +85fb +85ec +85dd +85ce +85bf +85b0 +85a1 +8593 +8584 +8575 +8567 +8558 +854a +853c +852e +8520 +8512 +8504 +84f6 +84e8 +84da +84cd +84bf +84b1 +84a4 +8497 +8489 +847c +846f +8462 +8455 +8448 +843b +842e +8422 +8415 +8408 +83fc +83f0 +83e3 +83d7 +83cb +83bf +83b3 +83a7 +839b +838f +8383 +8378 +836c +8361 +8355 +834a +833f +8333 +8328 +831d +8312 +8307 +82fc +82f2 +82e7 +82dc +82d2 +82c7 +82bd +82b3 +82a9 +829e +8294 +828a +8280 +8277 +826d +8263 +825a +8250 +8247 +823d +8234 +822b +8221 +8218 +820f +8206 +81fe +81f5 +81ec +81e3 +81db +81d2 +81ca +81c2 +81b9 +81b1 +81a9 +81a1 +8199 +8191 +8189 +8182 +817a +8173 +816b +8164 +815c +8155 +814e +8147 +8140 +8139 +8132 +812b +8124 +811e +8117 +8111 +810a +8104 +80fe +80f7 +80f1 +80eb +80e5 +80df +80da +80d4 +80ce +80c9 +80c3 +80be +80b8 +80b3 +80ae +80a9 +80a4 +809f +809a +8095 +8090 +808c +8087 +8083 +807e +807a +8076 +8071 +806d +8069 +8065 +8061 +805e +805a +8056 +8053 +804f +804c +8048 +8045 +8042 +803f +803c +8039 +8036 +8033 +8030 +802e +802b +8028 +8026 +8024 +8021 +801f +801d +801b +8019 +8017 +8015 +8014 +8012 +8010 +800f +800d +800c +800b +800a +8009 +8008 +8007 +8006 +8005 +8004 +8003 +8003 +8002 +8002 +8002 +8001 +8001 +8001 +8001 +8001 +8001 +8001 +8002 +8002 +8002 +8003 +8003 +8004 +8005 +8006 +8007 +8008 +8009 +800a +800b +800c +800d +800f +8010 +8012 +8014 +8015 +8017 +8019 +801b +801d +801f +8021 +8024 +8026 +8028 +802b +802e +8030 +8033 +8036 +8039 +803c +803f +8042 +8045 +8048 +804c +804f +8053 +8056 +805a +805e +8061 +8065 +8069 +806d +8071 +8076 +807a +807e +8083 +8087 +808c +8090 +8095 +809a +809f +80a4 +80a9 +80ae +80b3 +80b8 +80be +80c3 +80c9 +80ce +80d4 +80da +80df +80e5 +80eb +80f1 +80f7 +80fe +8104 +810a +8111 +8117 +811e +8124 +812b +8132 +8139 +8140 +8147 +814e +8155 +815c +8164 +816b +8173 +817a +8182 +8189 +8191 +8199 +81a1 +81a9 +81b1 +81b9 +81c2 +81ca +81d2 +81db +81e3 +81ec +81f5 +81fe +8206 +820f +8218 +8221 +822b +8234 +823d +8247 +8250 +825a +8263 +826d +8277 +8280 +828a +8294 +829e +82a9 +82b3 +82bd +82c7 +82d2 +82dc +82e7 +82f2 +82fc +8307 +8312 +831d +8328 +8333 +833f +834a +8355 +8361 +836c +8378 +8383 +838f +839b +83a7 +83b3 +83bf +83cb +83d7 +83e3 +83f0 +83fc +8408 +8415 +8422 +842e +843b +8448 +8455 +8462 +846f +847c +8489 +8497 +84a4 +84b1 +84bf +84cd +84da +84e8 +84f6 +8504 +8512 +8520 +852e +853c +854a +8558 +8567 +8575 +8584 +8593 +85a1 +85b0 +85bf +85ce +85dd +85ec +85fb +860a +861a +8629 +8638 +8648 +8657 +8667 +8677 +8687 +8696 +86a6 +86b6 +86c7 +86d7 +86e7 +86f7 +8708 +8718 +8729 +8739 +874a +875b +876c +877c +878d +879e +87b0 +87c1 +87d2 +87e3 +87f5 +8806 +8818 +8829 +883b +884d +885f +8871 +8883 +8895 +88a7 +88b9 +88cb +88de +88f0 +8902 +8915 +8928 +893a +894d +8960 +8973 +8986 +8999 +89ac +89bf +89d3 +89e6 +89f9 +8a0d +8a20 +8a34 +8a48 +8a5b +8a6f +8a83 +8a97 +8aab +8abf +8ad3 +8ae8 +8afc +8b10 +8b25 +8b3a +8b4e +8b63 +8b78 +8b8c +8ba1 +8bb6 +8bcb +8be0 +8bf6 +8c0b +8c20 +8c36 +8c4b +8c61 +8c76 +8c8c +8ca2 +8cb7 +8ccd +8ce3 +8cf9 +8d0f +8d25 +8d3c +8d52 +8d68 +8d7f +8d95 +8dac +8dc2 +8dd9 +8df0 +8e07 +8e1e +8e35 +8e4c +8e63 +8e7a +8e91 +8ea8 +8ec0 +8ed7 +8eef +8f06 +8f1e +8f36 +8f4e +8f65 +8f7d +8f95 +8fad +8fc6 +8fde +8ff6 +900e +9027 +903f +9058 +9070 +9089 +90a2 +90bb +90d4 +90ec +9105 +911f +9138 +9151 +916a +9184 +919d +91b6 +91d0 +91ea +9203 +921d +9237 +9251 +926b +9285 +929f +92b9 +92d3 +92ed +9308 +9322 +933d +9357 +9372 +938c +93a7 +93c2 +93dd +93f8 +9413 +942e +9449 +9464 +947f +949b +94b6 +94d1 +94ed +9508 +9524 +9540 +955c +9577 +9593 +95af +95cb +95e7 +9603 +9620 +963c +9658 +9675 +9691 +96ae +96ca +96e7 +9704 +9720 +973d +975a +9777 +9794 +97b1 +97ce +97ec +9809 +9826 +9844 +9861 +987f +989c +98ba +98d8 +98f6 +9913 +9931 +994f +996d +998b +99aa +99c8 +99e6 +9a04 +9a23 +9a41 +9a60 +9a7e +9a9d +9abc +9adb +9af9 +9b18 +9b37 +9b56 +9b75 +9b94 +9bb4 +9bd3 +9bf2 +9c12 +9c31 +9c51 +9c70 +9c90 +9caf +9ccf +9cef +9d0f +9d2f +9d4f +9d6f +9d8f +9daf +9dcf +9def +9e10 +9e30 +9e51 +9e71 +9e92 +9eb2 +9ed3 +9ef4 +9f15 +9f35 +9f56 +9f77 +9f98 +9fb9 +9fdb +9ffc +a01d +a03e +a060 +a081 +a0a3 +a0c4 +a0e6 +a108 +a129 +a14b +a16d +a18f +a1b1 +a1d3 +a1f5 +a217 +a239 +a25b +a27e +a2a0 +a2c2 +a2e5 +a307 +a32a +a34d +a36f +a392 +a3b5 +a3d8 +a3fb +a41e +a441 +a464 +a487 +a4aa +a4cd +a4f1 +a514 +a537 +a55b +a57e +a5a2 +a5c5 +a5e9 +a60d +a631 +a654 +a678 +a69c +a6c0 +a6e4 +a708 +a72d +a751 +a775 +a799 +a7be +a7e2 +a807 +a82b +a850 +a875 +a899 +a8be +a8e3 +a908 +a92d +a951 +a976 +a99c +a9c1 +a9e6 +aa0b +aa30 +aa56 +aa7b +aaa0 +aac6 +aaeb +ab11 +ab37 +ab5c +ab82 +aba8 +abce +abf4 +ac19 +ac3f +ac65 +ac8c +acb2 +acd8 +acfe +ad24 +ad4b +ad71 +ad98 +adbe +ade5 +ae0b +ae32 +ae58 +ae7f +aea6 +aecd +aef4 +af1b +af42 +af69 +af90 +afb7 +afde +b005 +b02c +b054 +b07b +b0a3 +b0ca +b0f2 +b119 +b141 +b168 +b190 +b1b8 +b1e0 +b207 +b22f +b257 +b27f +b2a7 +b2cf +b2f7 +b320 +b348 +b370 +b398 +b3c1 +b3e9 +b412 +b43a +b463 +b48b +b4b4 +b4dc +b505 +b52e +b557 +b580 +b5a8 +b5d1 +b5fa +b623 +b64c +b676 +b69f +b6c8 +b6f1 +b71b +b744 +b76d +b797 +b7c0 +b7ea +b813 +b83d +b866 +b890 +b8ba +b8e4 +b90d +b937 +b961 +b98b +b9b5 +b9df +ba09 +ba33 +ba5d +ba88 +bab2 +badc +bb07 +bb31 +bb5b +bb86 +bbb0 +bbdb +bc05 +bc30 +bc5b +bc85 +bcb0 +bcdb +bd06 +bd30 +bd5b +bd86 +bdb1 +bddc +be07 +be32 +be5e +be89 +beb4 +bedf +bf0a +bf36 +bf61 +bf8d +bfb8 +bfe3 +c00f +c03b +c066 +c092 +c0bd +c0e9 +c115 +c141 +c16d +c198 +c1c4 +c1f0 +c21c +c248 +c274 +c2a0 +c2cd +c2f9 +c325 +c351 +c37d +c3aa +c3d6 +c402 +c42f +c45b +c488 +c4b4 +c4e1 +c50e +c53a +c567 +c594 +c5c0 +c5ed +c61a +c647 +c674 +c6a0 +c6cd +c6fa +c727 +c755 +c782 +c7af +c7dc +c809 +c836 +c864 +c891 +c8be +c8eb +c919 +c946 +c974 +c9a1 +c9cf +c9fc +ca2a +ca58 +ca85 +cab3 +cae1 +cb0e +cb3c +cb6a +cb98 +cbc6 +cbf4 +cc21 +cc4f +cc7d +ccab +ccda +cd08 +cd36 +cd64 +cd92 +cdc0 +cdef +ce1d +ce4b +ce79 +cea8 +ced6 +cf05 +cf33 +cf62 +cf90 +cfbf +cfed +d01c +d04a +d079 +d0a8 +d0d6 +d105 +d134 +d163 +d192 +d1c0 +d1ef +d21e +d24d +d27c +d2ab +d2da +d309 +d338 +d367 +d396 +d3c6 +d3f5 +d424 +d453 +d483 +d4b2 +d4e1 +d510 +d540 +d56f +d59f +d5ce +d5fe +d62d +d65d +d68c +d6bc +d6eb +d71b +d74b +d77a +d7aa +d7da +d809 +d839 +d869 +d899 +d8c9 +d8f8 +d928 +d958 +d988 +d9b8 +d9e8 +da18 +da48 +da78 +daa8 +dad8 +db08 +db38 +db69 +db99 +dbc9 +dbf9 +dc29 +dc5a +dc8a +dcba +dceb +dd1b +dd4b +dd7c +ddac +dddd +de0d +de3e +de6e +de9f +decf +df00 +df30 +df61 +df91 +dfc2 +dff3 +e023 +e054 +e085 +e0b6 +e0e6 +e117 +e148 +e179 +e1a9 +e1da +e20b +e23c +e26d +e29e +e2cf +e300 +e331 +e362 +e393 +e3c4 +e3f5 +e426 +e457 +e488 +e4b9 +e4ea +e51b +e54c +e57e +e5af +e5e0 +e611 +e642 +e674 +e6a5 +e6d6 +e707 +e739 +e76a +e79b +e7cd +e7fe +e830 +e861 +e892 +e8c4 +e8f5 +e927 +e958 +e98a +e9bb +e9ed +ea1e +ea50 +ea81 +eab3 +eae4 +eb16 +eb47 +eb79 +ebab +ebdc +ec0e +ec40 +ec71 +eca3 +ecd5 +ed06 +ed38 +ed6a +ed9c +edcd +edff +ee31 +ee63 +ee94 +eec6 +eef8 +ef2a +ef5c +ef8e +efbf +eff1 +f023 +f055 +f087 +f0b9 +f0eb +f11d +f14f +f180 +f1b2 +f1e4 +f216 +f248 +f27a +f2ac +f2de +f310 +f342 +f374 +f3a6 +f3d8 +f40a +f43c +f46e +f4a1 +f4d3 +f505 +f537 +f569 +f59b +f5cd +f5ff +f631 +f663 +f696 +f6c8 +f6fa +f72c +f75e +f790 +f7c2 +f7f5 +f827 +f859 +f88b +f8bd +f8ef +f922 +f954 +f986 +f9b8 +f9ea +fa1d +fa4f +fa81 +fab3 +fae5 +fb18 +fb4a +fb7c +fbae +fbe1 +fc13 +fc45 +fc77 +fcaa +fcdc +fd0e +fd40 +fd73 +fda5 +fdd7 +fe09 +fe3c +fe6e +fea0 +fed2 +ff05 +ff37 +ff69 +ff9b +ffce From 7fbfd86cc6a21353247004df2b27b029c0938050 Mon Sep 17 00:00:00 2001 From: Brian Neff Date: Mon, 16 Mar 2026 14:01:07 -0400 Subject: [PATCH 2/2] Added README File for Digital Up and Down Conversion for Full Rate MC --- mc/Advanced/DigitalUpDownConversion/README.md | 334 ++++++++++++++++++ 1 file changed, 334 insertions(+) create mode 100644 mc/Advanced/DigitalUpDownConversion/README.md diff --git a/mc/Advanced/DigitalUpDownConversion/README.md b/mc/Advanced/DigitalUpDownConversion/README.md new file mode 100644 index 0000000..9a17d63 --- /dev/null +++ b/mc/Advanced/DigitalUpDownConversion/README.md @@ -0,0 +1,334 @@ +# Combined DDC/DUC Instrument Specification + +## 1. Overview + +This instrument implements a dual-mode digital frequency converter on the Moku:Delta platform. It operates as either a Digital Down Converter (DDC) for narrowband I/Q extraction, or a Digital Up Converter (DUC) for wideband RF synthesis. Mode selection is via Control3[0]. + +The instrument uses 16x interlacing at a 312.5 MHz clock, giving an effective sample rate of 5 GS/s. Both DDC and DUC paths produce 16 distinct output samples per clock cycle at full 5 GS/s effective bandwidth. + +``` + DDC path (Control3[0]=0) + ┌──────────────────────────────────────────────┐ + │ │ +InputA ──[d1]──[d2]──[d3]──┬── × lo_cos ── >>15 ── per-lane IIR(6) ──────────────────────────► OutputA (I) + │ (16 independent lanes, 16 distinct samples) + ┌─────────────┤ + │ DDC: InputA │ + │ DUC: InputB │ + └──── mux ────┴── × (−lo_sin) ── >>15 ── per-lane IIR(6) ──────────────────────► OutputB (Q) + │ (16 independent lanes, 16 distinct samples) +InputB ──[d1]──[d2]──[d3]──┘ │ + │ DUC path (Control3[0]=1) + NCO │ ┌────────────────────────────────────────────┐ +carrier_freq ──► phase_acc ──► sin/cos LUT ────── └─┤ I×cos − Q×sin ── >>1 ──────────────────► OutputA + (32-bit) (4096-entry) │ (per-lane subtract) OutputB = 0 + └────────────────────────────────────────────┘ +``` + +## 2. Inputs + +### 2.1 InputA — Primary Signal + +16-bit signed, 16 lanes. + +- **DDC mode**: Wideband RF signal to be downconverted. The I mixer path multiplies InputA by cos; the Q mixer path multiplies InputA by **−sin** (negative sine). This sign convention ensures that a tone above the carrier maps to a positive baseband frequency. +- **DUC mode**: In-phase (I) baseband component. Multiplied by cos(2πf_c t). + +### 2.2 InputB — Secondary Signal + +16-bit signed, 16 lanes. + +- **DDC mode, Control0 > 0**: Ignored. +- **DDC mode, Control0 = 0**: External LO. Replaces the NCO cosine output in the I mixer path. The sin path is zeroed (no quadrature without a Hilbert transform). +- **DUC mode**: Quadrature (Q) baseband component. Multiplied by sin(2πf_c t). + +### 2.3 InputC, InputD + +Unused. Not connected internally. + +## 3. Outputs + +### 3.1 DDC Mode (Control3[0] = 0) + +| Port | Content | +|------|---------| +| OutputA | Filtered I (in-phase) channel. Each of the 16 lanes carries a **distinct** time sample at full 5 GS/s effective bandwidth. | +| OutputB | Filtered Q (quadrature) channel. Each of the 16 lanes carries a **distinct** time sample at full 5 GS/s effective bandwidth. | +| OutputC | Zero. | +| OutputD | Zero. | + +### 3.2 DUC Mode (Control3[0] = 1) + +| Port | Content | +|------|---------| +| OutputA | Up-converted RF signal: InputA × cos(2πf_c t) − InputB × sin(2πf_c t). Each of the 16 lanes carries a distinct time sample at full 5 GS/s bandwidth. | +| OutputB | Zero. | +| OutputC | Zero. | +| OutputD | Zero. | + +## 4. Control Registers + +All control registers are 32-bit and read dynamically every clock cycle. Default values are the power-on reset state. + +| Register | Bits | Name | Mode | Format | Default | Description | +|:-----------------------|:--------:|:------------------:|:----:|:----------------|:-------:|:---------------------------------------------------------------------| +| `Control0` | `[31:0]` | `CarrierFrequency` | Both | Unsigned 32-bit | `0` | NCO phase increment. `0` selects external LO (DDC) or bypass (DUC). | +| `Control1` | `[31:0]` | `CutoffFrequency` | DDC | Unsigned 32-bit | `0` | IIR lowpass cutoff in Hz. Controls per-lane IIR coefficient. | +| `Control2` | `[31:0]` | — | — | — | `0` | Reserved. Write as zero. | +| `Control3` | `[0]` | `ModeSelect` | Both | Single bit | `0` | `0` = DDC, `1` = DUC. | +| `Control3` | `[31:1]` | — | — | — | `0` | Reserved. Write as zero. | +| `Control4`–`Control15` | `[31:0]` | — | — | — | `0` | Reserved. Write as zero. | + +### 4.1 Control0 — Carrier Frequency + +**Bits**: [31:0] +**Applies to**: Both modes. +**Range**: 0 to 2,000,000,000 (2 GHz). +**Units**: Hz. + +Sets the NCO carrier frequency. The NCO converts this to a 32-bit phase increment: + +``` +phase_increment = (carrier_freq_hz × 3,689,348,815) >> 32 +``` + +Frequency resolution is 5 GHz / 2^32 = 1.16 Hz. + +**When Control0 = 0:** + +| Mode | Behaviour | +|------|-----------| +| DDC | External LO mode. InputB replaces the NCO cosine; the sine path is zeroed. OutputB (Q) will be near-zero. | +| DUC | Natural bypass. The NCO produces cos(0) = +32767 and sin(0) = 0. OutputA = InputA × 0.5 (attenuated by the mixer and subtractor scaling stages). InputB has no effect. | + +### 4.2 Control1 — Cutoff Frequency + +**Bits**: [31:0] +**Applies to**: DDC mode only. Ignored in DUC mode. +**Units**: Hz. + +Controls the per-lane IIR lowpass filter cutoff. The IIR consists of 6 cascaded first-order sections per lane: `y[n] = α·x[n] + (1−α)·y[n-1]`. Each of the 16 I lanes and 16 Q lanes has its own independent IIR filter chain (32 chains total, 192 first-order sections). + +The coefficient α is computed from Control1: + +``` +α = 2π × f_cutoff / 312,500,000 +``` + +In Q0.16 fixed-point: + +``` +alpha_q16 = clamp(round(2π × f_cutoff × 65536 / 312,500,000), 0, 65535) +beta_q16 = 65536 − alpha_q16 +``` + +**Recomputation timing:** α and β are recomputed whenever Control1 changes. Since Control1 is read every clock cycle, the coefficient registers should be updated combinationally from Control1, then registered for use by the IIR. + +**Examples:** + +| Control1 (Hz) | alpha_q16 | Per-section −3 dB (Hz) | +|---|---|---| +| 10,000 | 13 | 9.87 kHz | +| 100,000 | 132 | 100 kHz | +| 500,000 | 659 | 500 kHz | +| 1,000,000 | 1,318 | 1.00 MHz | +| 5,000,000 | 6,589 | 5.00 MHz | +| 10,000,000 | 13,177 | 10.0 MHz | +| 50,000,000 | 65,535 (clamped) | ~49.7 MHz (passthrough) | + +**Minimum useful cutoff:** ~760 Hz per section (alpha_q16 = 1). For the 6-section cascade, the effective −3 dB is ~266 Hz. + +**Maximum useful cutoff:** ~49.7 MHz per section (alpha_q16 = 65535). Above this, the filter clamps to passthrough. + +When alpha_q16 = 0 (Control1 = 0), the IIR output holds at its last value (β = 1.0, the section becomes a latch). + +### 4.3 Control3 — Mode Select + +**Bits**: [0] +**Values**: 0 = DDC, 1 = DUC. + +Selects the operating mode. May be changed at runtime (see Section 7). + +**Bits [31:1]**: Reserved. Write as zero. + +### 4.4 Control4–Control15 + +Reserved. Write as zero. + +## 5. Status Registers + +| Register | Bits | Content | +|----------|------|---------| +| Status0 | [15:0] | Current IIR alpha_q16 value. | +| Status1 | [31:0] | Reserved (zero). | +| Status2 | [31:0] | Current NCO phase increment (raw 32-bit value). | +| Status3 | [0] | Current mode: 0 = DDC, 1 = DUC. | +| Status4–Status15 | [31:0] | Zero. | + +## 6. Operating Modes + +### 6.1 DDC — Narrowband Receiver + +**Configuration**: Control3[0] = 0, Control0 > 0. + +Downconverts a wideband RF input to narrowband baseband I/Q. The NCO generates cos and −sin at the carrier frequency. For each of the 16 lanes independently: + +1. **Mixer**: InputA[lane] × cos(phase[lane]) → I; InputA[lane] × (−sin(phase[lane])) → Q. Products are arithmetically right-shifted by 15 bits (Q1.15 normalisation) and saturated to 16 bits. +2. **Per-lane IIR**: The mixer output passes through 6 cascaded first-order IIR lowpass sections. Each section computes `y[n] = α·x[n] + (1−α)·y[n-1]` where α is derived from Control1. +3. **Output**: The filtered values are placed directly on OutputA (I) and OutputB (Q). Each lane carries a distinct time sample. + +Signals within the passband (set by Control1) of the carrier frequency appear as low-frequency I/Q components on the output. Signals outside the passband are attenuated by the per-lane IIR (120 dB/decade rolloff from the 6-section cascade). + +**Example** — extract a 1 MHz channel centered at 50 MHz: +``` +Control0 = 50000000 +Control1 = 1000000 +Control3 = 0 +``` + +### 6.2 DDC with External LO + +**Configuration**: Control3[0] = 0, Control0 = 0. + +Same signal path as Section 6.1, except InputB replaces the NCO cosine and the sine path is zeroed. This provides single-channel (I only) downconversion using an external reference. OutputB will be near-zero. + +### 6.3 DUC — Wideband Up Converter + +**Configuration**: Control3[0] = 1, Control0 > 0. + +Up-converts baseband I/Q to RF. InputA (I) is multiplied by cos(2πf_c t), InputB (Q) is multiplied by sin(2πf_c t), and the results are subtracted per-lane: + +``` +OutputA[lane] = (InputA[lane] × cos − InputB[lane] × sin) >> 16 +``` + +The `>> 16` represents the combined effect of the mixer's `>>> 15` (Q1.15 fixed-point normalisation) and the subtractor's `>> 1` (headroom scaling). The resulting gain is approximately 0.5. + +**Upper sideband** — I = cos(ω_m t), Q = sin(ω_m t): +``` +OutputA = (A/2) × cos((ω_c + ω_m) t) +``` + +**Lower sideband** — I = cos(ω_m t), Q = −sin(ω_m t): +``` +OutputA = (A/2) × cos((ω_c − ω_m) t) +``` + +**Double sideband (DSB-SC)** — Q = 0: +``` +OutputA = (A/2) × InputA × cos(ω_c t) +``` + +**Example** — generate upper sideband at 51 MHz from 1 MHz baseband: +``` +Control0 = 50000000 +Control3 = 1 +InputA = cos(2π × 1 MHz × t) × amplitude +InputB = sin(2π × 1 MHz × t) × amplitude +``` + +### 6.4 DUC Bypass + +**Configuration**: Control3[0] = 1, Control0 = 0. + +Passes InputA to OutputA at 0.5× gain (−6 dB). The NCO produces cos(0) = +32767 and sin(0) = 0, so the Q path contributes nothing. InputB is ignored. + +## 7. Mode Switching + +Control3[0] may be written at any time. + +**DDC to DUC**: The DUC output settles within 7 clock cycles. No overflow risk. + +**DUC to DDC**: The per-lane IIR filters will be in an arbitrary state. The IIR settling time is approximately 6/(2π × f_cutoff) seconds. For a 1 MHz cutoff this is ~1.0 µs (~312 clock cycles). + +## 8. Pipeline Latency + +### 8.1 Shared Stages (both modes) + +| Stage | Cycle | Operation | +|-------|-------|-----------| +| 1 | N | Input capture (`input_d1`) | +| 2 | N+1 | Input pipeline (`input_d2`) | +| 3 | N+2 | Input pipeline (`input_d3`); NCO LUT address registered | +| 4 | N+3 | NCO LUT read (BRAM output) | +| 5 | N+4 | NCO pipeline register; input and NCO aligned | +| 6 | N+5 | Mixer multiply (16 × 16 → 32 product) | +| 7 | N+6 | Mixer scale (`>>> 15`, saturate to 16-bit) | + +### 8.2 DDC Stages + +| Stage | Cycle | Operation | +|-------|-------|-----------| +| 8 | N+7 | IIR section 0: α·x + β·y_prev (per lane, multiply + accumulate) | +| 9 | N+8 | IIR section 0: register output | +| 10 | N+9 | IIR section 1: α·x + β·y_prev (per lane) | +| 11 | N+10 | IIR section 1: register output | +| 12 | N+11 | IIR section 2: α·x + β·y_prev (per lane) | +| 13 | N+12 | IIR section 2: register output | +| 14 | N+13 | IIR section 3: α·x + β·y_prev (per lane) | +| 15 | N+14 | IIR section 3: register output | +| 16 | N+15 | IIR section 4: α·x + β·y_prev (per lane) | +| 17 | N+16 | IIR section 4: register output | +| 18 | N+17 | IIR section 5: α·x + β·y_prev (per lane) | +| 19 | N+18 | IIR section 5: register output → OutputA/OutputB | + +**Total DDC latency**: 19 clock cycles from input to output. + +### 8.3 DUC Stages + +| Stage | Cycle | Operation | +|-------|-------|-----------| +| 8 | N+7 | Per-lane subtraction (I×cos − Q×sin), `>> 1`, output register | + +**Total DUC latency**: 7 clock cycles from input to output. + +## 9. Signal Gain + +### 9.1 DDC + +The mixer produces a Q1.15 normalised output. The IIR sections are unity-gain at DC. The overall DDC passband gain is approximately 0.5× (−6 dB) due to the mixer normalisation. + +For a sinusoidal input at exactly the carrier frequency (DC in baseband), the I output amplitude is approximately `InputA_amplitude / 2`. The Q output is approximately zero. + +### 9.2 DUC + +The gain from input to output is 0.5× (−6 dB), comprising: + +1. Mixer: 16-bit × 16-bit = 32-bit product, arithmetic right shift by 15 → approximately unity in Q1.15 format. +2. Subtractor: `>> 1` for headroom in the I − Q subtraction → 0.5× additional. + +For a DC input of amplitude A on InputA with InputB = 0 and Control0 > 0, the output peak is A/2. + +## 10. NCO + +The NCO uses a 32-bit phase accumulator with 4096-entry sin/cos BRAM lookup tables (16-bit signed, one pair replicated per lane for parallel access). The LUT is addressed by the top 12 bits of each lane's phase. + +Per-lane phase is computed combinationally: + +``` +lane_phase[g] = phase_acc + phase_increment × g +``` + +where `phase_acc` advances by `phase_increment × 16` each clock cycle. This avoids a per-lane registered multiply, at the cost of a combinational multiply on the phase path. The combinational multiply is safe at 312.5 MHz because it feeds into a registered LUT address (not a DSP critical path). + +## 11. Limitations + +1. **DUC bypass gain is 0.5×**, not unity. An explicit bypass pipeline would restore unity gain but adds mux complexity. + +2. **Minimum DDC cutoff is ~760 Hz** (single section) / ~266 Hz (6-section cascade). Below this, alpha_q16 quantises to zero and the filter output freezes. For sub-kHz narrowband applications, a wider fixed-point representation (e.g., Q0.24) would be needed. + +3. **External LO has no quadrature**. In DDC mode with Control0 = 0, only the cosine path uses InputB. The sine path is zeroed. OutputB (Q) is therefore near-zero in this mode. + +4. **Per-lane IIR resource cost**. 192 first-order IIR sections (16 lanes × 2 channels × 6 stages). Resource sharing (time-multiplexing across lanes) can reduce DSP usage at the cost of pipeline complexity. + +## 12. Resource Estimate + +| Resource | Count | Notes | +|----------|-------|-------| +| BRAM | 32 | 16 lanes × 2 LUTs (sin + cos), 4096 × 16-bit each | +| DSP48 (mixer) | 32 | 16 lanes × 2 mixer multiplies (I cos, Q sin) | +| DSP48 (IIR) | 192 | 16 lanes × 2 (I+Q) × 6 sections × 1 multiply each | +| DSP48 (total) | ~224 | ~5.2% of Moku:Delta's 4,272 DSP48E2 slices | +| Registers (IIR state) | ~6,144 | 192 sections × 32-bit accumulator state | +| LUTs (DUC) | ~800 | 16 subtractors + 16 output muxes | +| Registers (DUC) | ~512 | 16 × 16-bit duc_out registers + mode decode |