diff --git a/blocks/TFFs/TFF.ice b/blocks/TFFs/TFF.ice index 78f31b0..3d45926 100644 --- a/blocks/TFFs/TFF.ice +++ b/blocks/TFFs/TFF.ice @@ -1,9 +1,9 @@ { "version": "1.2", "package": { - "name": "TFF", - "version": "0.3", - "description": "System TFF with toggle input: It toogles on every system cycle if the input is active", + "name": "TFF-verilog", + "version": "0.4", + "description": "TFF-verilog. System TFF with toggle input: It toogles on every system cycle if the input is active. Verilog implementation", "author": "Juan González-Gómez (Obijuan)", "image": "%3Csvg%20width=%22446.564%22%20height=%22323.478%22%20viewBox=%220%200%20118.15346%2085.586967%22%20xmlns=%22http://www.w3.org/2000/svg%22%3E%3Ctext%20style=%22line-height:1.25;-inkscape-font-specification:ubuntu%22%20x=%2217.105%22%20y=%22102.424%22%20font-weight=%22400%22%20font-size=%2243.588%22%20font-family=%22ubuntu%22%20letter-spacing=%220%22%20word-spacing=%220%22%20stroke-width=%222.724%22%20transform=%22translate(3.689%20-56.576)%22%3E%3Ctspan%20x=%2217.105%22%20y=%22102.424%22%20style=%22-inkscape-font-specification:'ubuntu%20Medium'%22%20font-weight=%22500%22%3E1%3C/tspan%3E%3C/text%3E%3Cpath%20d=%22M103.647%2011.233l8.692-8.353-1.016%2027.43-26.866-1.016%208.24-8.128s-6.32-6.66-17.496-6.773c-11.175-.113-17.948%206.209-17.948%206.209l.113-9.256-6.999-3.048S61.317-.282%2075.88.396c14.561.677%2027.768%2010.837%2027.768%2010.837zM44.599%2074.354l-8.692%208.353%201.016-27.43%2026.866%201.016-8.24%208.128s6.32%206.66%2017.496%206.773c11.175.112%2017.948-6.209%2017.948-6.209l-.113%209.256%206.999%203.048s-10.95%208.58-25.511%207.902c-14.562-.677-27.77-10.837-27.77-10.837z%22%20fill=%22green%22%20stroke=%22#000%22%20stroke-width=%22.716%22/%3E%3Ctext%20style=%22line-height:1.25;-inkscape-font-specification:ubuntu%22%20x=%2291.581%22%20y=%22124.887%22%20font-weight=%22400%22%20font-size=%2243.588%22%20font-family=%22ubuntu%22%20letter-spacing=%220%22%20word-spacing=%220%22%20stroke-width=%222.724%22%20transform=%22translate(3.689%20-56.576)%22%3E%3Ctspan%20x=%2291.581%22%20y=%22124.887%22%20style=%22-inkscape-font-specification:'ubuntu%20Medium'%22%20font-weight=%22500%22%3E0%3C/tspan%3E%3C/text%3E%3Cpath%20d=%22M77.094%2046.485l3.003%2011.933-7.058-10.182%22%20fill=%22#ccc%22%20stroke=%22#000%22%20stroke-width=%22.716%22%20stroke-linecap=%22round%22%20stroke-linejoin=%22round%22/%3E%3Cpath%20d=%22M75.915%2040.345l-5.845-10.93%203.91-1.687-.938-2.172-12.672%205.47.938%202.172%203.693-1.594%204.253%2011.738s-2.772%201.786-2.574%204.168c.198%202.383%201.397%202.835%201.203%202.954l14.342-6.211s-.723-2.568-2.38-3.311c-1.657-.743-3.93-.597-3.93-.597z%22%20fill=%22red%22%20stroke=%22#000%22%20stroke-width=%22.716%22%20stroke-linecap=%22round%22%20stroke-linejoin=%22round%22/%3E%3Cg%20transform=%22matrix(1.18163%200%200%201.18163%20-101.312%20-19.89)%22%20stroke=%22green%22%20stroke-linecap=%22round%22%3E%3Ccircle%20cx=%22100.602%22%20cy=%2273.815%22%20r=%2214.559%22%20fill=%22#ececec%22%20stroke-width=%22.608%22%20stroke-linejoin=%22round%22/%3E%3Cpath%20d=%22M106.978%2082.142h-3.353V63.316H97.54v18.678h-3.652%22%20fill=%22none%22%20stroke-width=%221.521%22/%3E%3C/g%3E%3C/svg%3E", "otid": 1618503523961 @@ -12,19 +12,6 @@ "board": "alhambra-ii", "graph": { "blocks": [ - { - "id": "b9359b10-b14f-4dd7-adf9-3f4f22bc65e6", - "type": "basic.outputLabel", - "data": { - "blockColor": "yellow", - "name": "clk", - "oldBlockColor": "fuchsia" - }, - "position": { - "x": 456, - "y": -160 - } - }, { "id": "ca7c5f10-efb6-43f9-9364-52d751fc0bc6", "type": "basic.input", @@ -33,60 +20,19 @@ "clock": true }, "position": { - "x": 80, - "y": -112 - } - }, - { - "id": "0a772657-8018-424d-8f04-75d3ffff3692", - "type": "basic.inputLabel", - "data": { - "blockColor": "yellow", - "name": "clk", - "pins": [ - { - "index": "0", - "name": "", - "value": "" - } - ], - "virtual": true - }, - "position": { - "x": 232, - "y": -112 + "x": 328, + "y": -80 } }, { "id": "4e8afe74-8f38-4873-97ee-f7585d99a4aa", "type": "basic.output", "data": { - "name": "", - "virtual": false - }, - "position": { - "x": 800, - "y": -112 - } - }, - { - "id": "f20a4359-8546-4dda-aa5c-d08bfe4724a0", - "type": "basic.outputLabel", - "data": { - "name": "next", - "blockColor": "fuchsia", - "virtual": true, - "pins": [ - { - "index": "0", - "name": "NULL", - "value": "NULL" - } - ] + "name": "" }, "position": { - "x": 464, - "y": -64 + "x": 904, + "y": -8 } }, { @@ -94,79 +40,11 @@ "type": "basic.input", "data": { "name": "", - "virtual": true, - "pins": [ - { - "index": "0", - "name": "NULL", - "value": "NULL" - } - ], "clock": false }, "position": { - "x": 80, - "y": -40 - } - }, - { - "id": "81f5e1f9-e867-4639-98b5-e12f7551751d", - "type": "basic.inputLabel", - "data": { - "name": "toggle", - "blockColor": "fuchsia", - "virtual": true, - "pins": [ - { - "index": "0", - "name": "NULL", - "value": "NULL" - } - ] - }, - "position": { - "x": 224, - "y": -40 - } - }, - { - "id": "8f321a4f-979f-46f9-b40f-524e6bc0008a", - "type": "basic.inputLabel", - "data": { - "name": "next", - "blockColor": "fuchsia", - "virtual": true, - "pins": [ - { - "index": "0", - "name": "NULL", - "value": "NULL" - } - ] - }, - "position": { - "x": 880, - "y": 16 - } - }, - { - "id": "a66e0e19-f794-47df-b52e-c663ff7fa3e2", - "type": "basic.outputLabel", - "data": { - "name": "toggle", - "blockColor": "fuchsia", - "virtual": true, - "pins": [ - { - "index": "0", - "name": "NULL", - "value": "NULL" - } - ] - }, - "position": { - "x": 464, - "y": 32 + "x": 320, + "y": 64 } }, { @@ -178,416 +56,89 @@ "local": false }, "position": { - "x": 600, - "y": -232 + "x": 624, + "y": -248 } }, { - "id": "1f324b9b-a8a8-43b9-9c34-2207a3ea75a5", - "type": "3676a00f3a70e406487ed14b901daf3e4984e63d", - "position": { - "x": 736, - "y": 16 + "id": "60198e6c-e8ec-433b-a4fb-55bed9afcc45", + "type": "basic.code", + "data": { + "ports": { + "in": [ + { + "name": "clk" + }, + { + "name": "t" + } + ], + "out": [ + { + "name": "q" + } + ] + }, + "params": [ + { + "name": "INI" + } + ], + "code": "//-- Initial value\nreg qi = INI;\n\nalways @(posedge clk)\nbegin\n \n //-- check the toogle input\n if (t == 1'b1)\n qi <= ~ qi;\n \nend\n\n//-- Connect the register with the\n//-- output\nassign q = qi;\n" }, - "size": { - "width": 96, - "height": 64 - } - }, - { - "id": "6e8b3562-d62b-487d-b3d1-829589f86c5f", - "type": "407d80e33e1e8f0d8cbc561cc519af27a522cb6b", "position": { - "x": 600, - "y": -80 + "x": 496, + "y": -120 }, "size": { - "width": 96, - "height": 96 + "width": 352, + "height": 288 } } ], "wires": [ { "source": { - "block": "ca7c5f10-efb6-43f9-9364-52d751fc0bc6", - "port": "out" - }, - "target": { - "block": "0a772657-8018-424d-8f04-75d3ffff3692", - "port": "inlabel" - }, - "vertices": [] - }, - { - "source": { - "block": "b9359b10-b14f-4dd7-adf9-3f4f22bc65e6", - "port": "outlabel" + "block": "915bebf3-8f1a-4547-8056-fe3e75c77022", + "port": "constant-out" }, "target": { - "block": "6e8b3562-d62b-487d-b3d1-829589f86c5f", - "port": "df0c1bb1-f8ef-49f3-b71f-9384c29a9735" + "block": "60198e6c-e8ec-433b-a4fb-55bed9afcc45", + "port": "INI" } }, { "source": { - "block": "fcbd52d3-d1b8-4cd4-befc-e045d20b91e4", + "block": "ca7c5f10-efb6-43f9-9364-52d751fc0bc6", "port": "out" }, "target": { - "block": "81f5e1f9-e867-4639-98b5-e12f7551751d", - "port": "inlabel" - } - }, - { - "source": { - "block": "a66e0e19-f794-47df-b52e-c663ff7fa3e2", - "port": "outlabel" - }, - "target": { - "block": "6e8b3562-d62b-487d-b3d1-829589f86c5f", - "port": "58d2c88e-2434-438f-986b-0f5b9c3654ca" - } - }, - { - "source": { - "block": "1f324b9b-a8a8-43b9-9c34-2207a3ea75a5", - "port": "664caf9e-5f40-4df4-800a-b626af702e62" - }, - "target": { - "block": "8f321a4f-979f-46f9-b40f-524e6bc0008a", - "port": "inlabel" + "block": "60198e6c-e8ec-433b-a4fb-55bed9afcc45", + "port": "clk" } }, { "source": { - "block": "f20a4359-8546-4dda-aa5c-d08bfe4724a0", - "port": "outlabel" + "block": "fcbd52d3-d1b8-4cd4-befc-e045d20b91e4", + "port": "out" }, "target": { - "block": "6e8b3562-d62b-487d-b3d1-829589f86c5f", - "port": "adf3a6ae-71e2-43dd-b504-c2cdbc14dab7" + "block": "60198e6c-e8ec-433b-a4fb-55bed9afcc45", + "port": "t" } }, { "source": { - "block": "6e8b3562-d62b-487d-b3d1-829589f86c5f", - "port": "4e8afe74-8f38-4873-97ee-f7585d99a4aa" - }, - "target": { - "block": "1f324b9b-a8a8-43b9-9c34-2207a3ea75a5", - "port": "18c2ebc7-5152-439c-9b3f-851c59bac834" - }, - "vertices": [] - }, - { - "source": { - "block": "6e8b3562-d62b-487d-b3d1-829589f86c5f", - "port": "4e8afe74-8f38-4873-97ee-f7585d99a4aa" + "block": "60198e6c-e8ec-433b-a4fb-55bed9afcc45", + "port": "q" }, "target": { "block": "4e8afe74-8f38-4873-97ee-f7585d99a4aa", "port": "in" } - }, - { - "source": { - "block": "915bebf3-8f1a-4547-8056-fe3e75c77022", - "port": "constant-out" - }, - "target": { - "block": "6e8b3562-d62b-487d-b3d1-829589f86c5f", - "port": "be33796a-a109-4ab0-a53b-dd6ec67587cd" - } } ] } }, - "dependencies": { - "3676a00f3a70e406487ed14b901daf3e4984e63d": { - "package": { - "name": "NOT", - "version": "2.0", - "description": "NOT gate (Verilog implementation)", - "author": "Jesús Arroyo, Juan González", - "image": "%3Csvg%20xmlns=%22http://www.w3.org/2000/svg%22%20width=%22317.651%22%20height=%22194.058%22%20version=%221%22%3E%3Cpath%20d=%22M69.246%204l161.86%2093.027-161.86%2093.031V4z%22%20fill=%22none%22%20stroke=%22#000%22%20stroke-width=%228%22%20stroke-linejoin=%22round%22/%3E%3Cellipse%20cx=%22253.352%22%20cy=%2296.736%22%20rx=%2221.393%22%20ry=%2221.893%22%20fill=%22none%22%20stroke=%22#000%22%20stroke-width=%228%22%20stroke-linecap=%22round%22%20stroke-linejoin=%22round%22/%3E%3Cpath%20d=%22M4.057%2097.49h65.262m205.796%200h38.48%22%20fill=%22none%22%20stroke=%22#000%22%20stroke-width=%228%22%20stroke-linecap=%22round%22/%3E%3Ctext%20style=%22line-height:125%25%22%20x=%2281.112%22%20y=%22111.734%22%20transform=%22scale(.99532%201.0047)%22%20font-weight=%22400%22%20font-size=%2249.675%22%20font-family=%22sans-serif%22%20letter-spacing=%220%22%20word-spacing=%220%22%20fill=%22#00f%22%3E%3Ctspan%20x=%2281.112%22%20y=%22111.734%22%20style=%22-inkscape-font-specification:'sans-serif%20Bold'%22%20font-weight=%22700%22%3ENot%3C/tspan%3E%3C/text%3E%3C/svg%3E" - }, - "design": { - "graph": { - "blocks": [ - { - "id": "18c2ebc7-5152-439c-9b3f-851c59bac834", - "type": "basic.input", - "data": { - "name": "" - }, - "position": { - "x": 112, - "y": 72 - } - }, - { - "id": "664caf9e-5f40-4df4-800a-b626af702e62", - "type": "basic.output", - "data": { - "name": "" - }, - "position": { - "x": 560, - "y": 72 - } - }, - { - "id": "5365ed8c-e5db-4445-938f-8d689830ea5c", - "type": "basic.code", - "data": { - "code": "//-- NOT Gate\nassign q = ~a;\n\n", - "params": [], - "ports": { - "in": [ - { - "name": "a" - } - ], - "out": [ - { - "name": "q" - } - ] - } - }, - "position": { - "x": 256, - "y": 48 - }, - "size": { - "width": 256, - "height": 104 - } - }, - { - "id": "e3bb41e3-1944-4946-9675-c2dbe2e49fcf", - "type": "basic.info", - "data": { - "info": "Input", - "readonly": true - }, - "position": { - "x": 128, - "y": 32 - }, - "size": { - "width": 80, - "height": 40 - } - }, - { - "id": "8408dd5f-945f-4a89-9790-7752813d4e91", - "type": "basic.info", - "data": { - "info": "Output", - "readonly": true - }, - "position": { - "x": 576, - "y": 40 - }, - "size": { - "width": 80, - "height": 40 - } - } - ], - "wires": [ - { - "source": { - "block": "18c2ebc7-5152-439c-9b3f-851c59bac834", - "port": "out" - }, - "target": { - "block": "5365ed8c-e5db-4445-938f-8d689830ea5c", - "port": "a" - } - }, - { - "source": { - "block": "5365ed8c-e5db-4445-938f-8d689830ea5c", - "port": "q" - }, - "target": { - "block": "664caf9e-5f40-4df4-800a-b626af702e62", - "port": "in" - } - } - ] - } - } - }, - "407d80e33e1e8f0d8cbc561cc519af27a522cb6b": { - "package": { - "name": "DFF-verilog", - "version": "0.1", - "description": "DFF. D Flip-flop. Verilog implementation", - "author": "Juan González-Gómez (Obijuan)", - "image": "%3Csvg%20xmlns=%22http://www.w3.org/2000/svg%22%20width=%22216.379%22%20height=%22279.911%22%20viewBox=%220%200%2057.25032%2074.059853%22%3E%3Cg%20stroke=%22#000%22%20stroke-width=%221.442%22%20stroke-linecap=%22round%22%20stroke-linejoin=%22round%22%3E%3Cpath%20d=%22M41.506%2040.152l13.608%2016.672-6.918-20.534%22%20fill=%22#ccc%22%20stroke-width=%221.0924880399999999%22/%3E%3Cpath%20d=%22M34.122%2032.088L24.89%2012.475l-6.45%203.724-2.07-3.583L37.276.546l2.07%203.584-6.093%203.517%2012.03%2018.223s5.4-2.025%208.536.74c3.136%202.766%202.52%204.92%202.887%204.772L33.017%2045.02s-2.849-3.695-2.16-6.795c.687-3.1%203.265-6.137%203.265-6.137z%22%20fill=%22red%22%20stroke-width=%221.0924880399999999%22/%3E%3C/g%3E%3Cg%20transform=%22translate(-93.518%20-22.665)%20scale(1.09073)%22%20stroke=%22green%22%20stroke-linecap=%22round%22%3E%3Ccircle%20cx=%22100.602%22%20cy=%2273.815%22%20r=%2214.559%22%20fill=%22#ececec%22%20stroke-width=%22.608%22%20stroke-linejoin=%22round%22/%3E%3Cpath%20d=%22M106.978%2082.142h-3.353V63.316H97.54v18.678h-3.652%22%20fill=%22none%22%20stroke-width=%221.521%22/%3E%3C/g%3E%3C/svg%3E", - "otid": 1594812046378 - }, - "design": { - "graph": { - "blocks": [ - { - "id": "df0c1bb1-f8ef-49f3-b71f-9384c29a9735", - "type": "basic.input", - "data": { - "name": "", - "clock": true - }, - "position": { - "x": 128, - "y": 424 - } - }, - { - "id": "adf3a6ae-71e2-43dd-b504-c2cdbc14dab7", - "type": "basic.input", - "data": { - "name": "d", - "clock": false - }, - "position": { - "x": 128, - "y": 536 - } - }, - { - "id": "4e8afe74-8f38-4873-97ee-f7585d99a4aa", - "type": "basic.output", - "data": { - "name": "" - }, - "position": { - "x": 824, - "y": 536 - } - }, - { - "id": "58d2c88e-2434-438f-986b-0f5b9c3654ca", - "type": "basic.input", - "data": { - "name": "load", - "clock": false - }, - "position": { - "x": 128, - "y": 648 - } - }, - { - "id": "be33796a-a109-4ab0-a53b-dd6ec67587cd", - "type": "basic.constant", - "data": { - "name": "", - "value": "0", - "local": false - }, - "position": { - "x": 488, - "y": 280 - } - }, - { - "id": "5bffd6ef-bb9d-4d3f-a4f0-f91c6040ddc5", - "type": "basic.code", - "data": { - "ports": { - "in": [ - { - "name": "clk" - }, - { - "name": "d" - }, - { - "name": "load" - } - ], - "out": [ - { - "name": "q" - } - ] - }, - "params": [ - { - "name": "INI" - } - ], - "code": "//-- Initial value\nreg q = INI;\n\nalways @(posedge clk)\nbegin\n \n //-- When load is active\n //-- the input data is captured\n if (load == 1'b1)\n q <= d;\n \nend\n" - }, - "position": { - "x": 320, - "y": 400 - }, - "size": { - "width": 424, - "height": 336 - } - } - ], - "wires": [ - { - "source": { - "block": "df0c1bb1-f8ef-49f3-b71f-9384c29a9735", - "port": "out" - }, - "target": { - "block": "5bffd6ef-bb9d-4d3f-a4f0-f91c6040ddc5", - "port": "clk" - } - }, - { - "source": { - "block": "adf3a6ae-71e2-43dd-b504-c2cdbc14dab7", - "port": "out" - }, - "target": { - "block": "5bffd6ef-bb9d-4d3f-a4f0-f91c6040ddc5", - "port": "d" - } - }, - { - "source": { - "block": "58d2c88e-2434-438f-986b-0f5b9c3654ca", - "port": "out" - }, - "target": { - "block": "5bffd6ef-bb9d-4d3f-a4f0-f91c6040ddc5", - "port": "load" - } - }, - { - "source": { - "block": "5bffd6ef-bb9d-4d3f-a4f0-f91c6040ddc5", - "port": "q" - }, - "target": { - "block": "4e8afe74-8f38-4873-97ee-f7585d99a4aa", - "port": "in" - } - }, - { - "source": { - "block": "be33796a-a109-4ab0-a53b-dd6ec67587cd", - "port": "constant-out" - }, - "target": { - "block": "5bffd6ef-bb9d-4d3f-a4f0-f91c6040ddc5", - "port": "INI" - } - } - ] - } - } - } - } + "dependencies": {} } \ No newline at end of file diff --git a/examples/TESTs/TFFs/TFF/Alhambra-II/01-manual-testing.ice b/examples/TESTs/TFFs/TFF/Alhambra-II/01-manual-testing.ice index 91e411a..516bf51 100644 --- a/examples/TESTs/TFFs/TFF/Alhambra-II/01-manual-testing.ice +++ b/examples/TESTs/TFFs/TFF/Alhambra-II/01-manual-testing.ice @@ -92,8 +92,8 @@ } }, { - "id": "21d91ade-04be-470d-b111-8098a99a1735", - "type": "05b06ebe84ae854b224676998d9ded6c30d3e4ac", + "id": "896aaf78-c3e6-4ac5-95b9-d820f90f59ae", + "type": "6ac7ddf463b070e3a2e40ffee0481f3a5a643dd4", "position": { "x": 1016, "y": 48 @@ -107,7 +107,7 @@ "wires": [ { "source": { - "block": "21d91ade-04be-470d-b111-8098a99a1735", + "block": "896aaf78-c3e6-4ac5-95b9-d820f90f59ae", "port": "4e8afe74-8f38-4873-97ee-f7585d99a4aa" }, "target": { @@ -121,7 +121,7 @@ "port": "constant-out" }, "target": { - "block": "21d91ade-04be-470d-b111-8098a99a1735", + "block": "896aaf78-c3e6-4ac5-95b9-d820f90f59ae", "port": "915bebf3-8f1a-4547-8056-fe3e75c77022" } }, @@ -141,7 +141,7 @@ "port": "997db8c4-b772-49d8-83e7-4427aff720e6" }, "target": { - "block": "21d91ade-04be-470d-b111-8098a99a1735", + "block": "896aaf78-c3e6-4ac5-95b9-d820f90f59ae", "port": "fcbd52d3-d1b8-4cd4-befc-e045d20b91e4" } } @@ -10251,11 +10251,11 @@ } } }, - "05b06ebe84ae854b224676998d9ded6c30d3e4ac": { + "6ac7ddf463b070e3a2e40ffee0481f3a5a643dd4": { "package": { - "name": "TFF-block", - "version": "0.3", - "description": "TFF-block. System TFF with toggle input: It toogles on every system cycle if the input is active. Block implementation", + "name": "TFF-verilog", + "version": "0.4", + "description": "TFF-verilog. System TFF with toggle input: It toogles on every system cycle if the input is active. Verilog implementation", "author": "Juan González-Gómez (Obijuan)", "image": "%3Csvg%20width=%22446.564%22%20height=%22323.478%22%20viewBox=%220%200%20118.15346%2085.586967%22%20xmlns=%22http://www.w3.org/2000/svg%22%3E%3Ctext%20style=%22line-height:1.25;-inkscape-font-specification:ubuntu%22%20x=%2217.105%22%20y=%22102.424%22%20font-weight=%22400%22%20font-size=%2243.588%22%20font-family=%22ubuntu%22%20letter-spacing=%220%22%20word-spacing=%220%22%20stroke-width=%222.724%22%20transform=%22translate(3.689%20-56.576)%22%3E%3Ctspan%20x=%2217.105%22%20y=%22102.424%22%20style=%22-inkscape-font-specification:'ubuntu%20Medium'%22%20font-weight=%22500%22%3E1%3C/tspan%3E%3C/text%3E%3Cpath%20d=%22M103.647%2011.233l8.692-8.353-1.016%2027.43-26.866-1.016%208.24-8.128s-6.32-6.66-17.496-6.773c-11.175-.113-17.948%206.209-17.948%206.209l.113-9.256-6.999-3.048S61.317-.282%2075.88.396c14.561.677%2027.768%2010.837%2027.768%2010.837zM44.599%2074.354l-8.692%208.353%201.016-27.43%2026.866%201.016-8.24%208.128s6.32%206.66%2017.496%206.773c11.175.112%2017.948-6.209%2017.948-6.209l-.113%209.256%206.999%203.048s-10.95%208.58-25.511%207.902c-14.562-.677-27.77-10.837-27.77-10.837z%22%20fill=%22green%22%20stroke=%22#000%22%20stroke-width=%22.716%22/%3E%3Ctext%20style=%22line-height:1.25;-inkscape-font-specification:ubuntu%22%20x=%2291.581%22%20y=%22124.887%22%20font-weight=%22400%22%20font-size=%2243.588%22%20font-family=%22ubuntu%22%20letter-spacing=%220%22%20word-spacing=%220%22%20stroke-width=%222.724%22%20transform=%22translate(3.689%20-56.576)%22%3E%3Ctspan%20x=%2291.581%22%20y=%22124.887%22%20style=%22-inkscape-font-specification:'ubuntu%20Medium'%22%20font-weight=%22500%22%3E0%3C/tspan%3E%3C/text%3E%3Cpath%20d=%22M77.094%2046.485l3.003%2011.933-7.058-10.182%22%20fill=%22#ccc%22%20stroke=%22#000%22%20stroke-width=%22.716%22%20stroke-linecap=%22round%22%20stroke-linejoin=%22round%22/%3E%3Cpath%20d=%22M75.915%2040.345l-5.845-10.93%203.91-1.687-.938-2.172-12.672%205.47.938%202.172%203.693-1.594%204.253%2011.738s-2.772%201.786-2.574%204.168c.198%202.383%201.397%202.835%201.203%202.954l14.342-6.211s-.723-2.568-2.38-3.311c-1.657-.743-3.93-.597-3.93-.597z%22%20fill=%22red%22%20stroke=%22#000%22%20stroke-width=%22.716%22%20stroke-linecap=%22round%22%20stroke-linejoin=%22round%22/%3E%3Cg%20transform=%22matrix(1.18163%200%200%201.18163%20-101.312%20-19.89)%22%20stroke=%22green%22%20stroke-linecap=%22round%22%3E%3Ccircle%20cx=%22100.602%22%20cy=%2273.815%22%20r=%2214.559%22%20fill=%22#ececec%22%20stroke-width=%22.608%22%20stroke-linejoin=%22round%22/%3E%3Cpath%20d=%22M106.978%2082.142h-3.353V63.316H97.54v18.678h-3.652%22%20fill=%22none%22%20stroke-width=%221.521%22/%3E%3C/g%3E%3C/svg%3E", "otid": 1618503523961 @@ -10263,19 +10263,6 @@ "design": { "graph": { "blocks": [ - { - "id": "b9359b10-b14f-4dd7-adf9-3f4f22bc65e6", - "type": "basic.outputLabel", - "data": { - "blockColor": "yellow", - "name": "clk", - "oldBlockColor": "fuchsia" - }, - "position": { - "x": 464, - "y": -224 - } - }, { "id": "ca7c5f10-efb6-43f9-9364-52d751fc0bc6", "type": "basic.input", @@ -10284,20 +10271,8 @@ "clock": true }, "position": { - "x": 0, - "y": -104 - } - }, - { - "id": "0a772657-8018-424d-8f04-75d3ffff3692", - "type": "basic.inputLabel", - "data": { - "blockColor": "yellow", - "name": "clk" - }, - "position": { - "x": 152, - "y": -104 + "x": 328, + "y": -80 } }, { @@ -10307,68 +10282,8 @@ "name": "" }, "position": { - "x": 1040, - "y": -64 - } - }, - { - "id": "f20a4359-8546-4dda-aa5c-d08bfe4724a0", - "type": "basic.outputLabel", - "data": { - "name": "output", - "blockColor": "darkgreen", - "virtual": true, - "pins": [ - { - "index": "0", - "name": "NULL", - "value": "NULL" - } - ] - }, - "position": { - "x": 296, - "y": -64 - } - }, - { - "id": "8f321a4f-979f-46f9-b40f-524e6bc0008a", - "type": "basic.inputLabel", - "data": { - "name": "output", - "blockColor": "darkgreen", - "virtual": true, - "pins": [ - { - "index": "0", - "name": "NULL", - "value": "NULL" - } - ] - }, - "position": { - "x": 736, - "y": -64 - } - }, - { - "id": "6289de91-cf70-4c94-af49-303c69b742b4", - "type": "basic.outputLabel", - "data": { - "name": "output", - "blockColor": "darkgreen", - "virtual": true, - "pins": [ - { - "index": "0", - "name": "NULL", - "value": "NULL" - } - ] - }, - "position": { - "x": 896, - "y": -64 + "x": 904, + "y": -8 } }, { @@ -10379,32 +10294,8 @@ "clock": false }, "position": { - "x": 0, - "y": -32 - } - }, - { - "id": "81f5e1f9-e867-4639-98b5-e12f7551751d", - "type": "basic.inputLabel", - "data": { - "name": "toggle", - "blockColor": "fuchsia" - }, - "position": { - "x": 144, - "y": -32 - } - }, - { - "id": "a66e0e19-f794-47df-b52e-c663ff7fa3e2", - "type": "basic.outputLabel", - "data": { - "name": "toggle", - "blockColor": "fuchsia" - }, - "position": { - "x": 440, - "y": 32 + "x": 320, + "y": 64 } }, { @@ -10416,221 +10307,12 @@ "local": false }, "position": { - "x": 600, - "y": -176 - } - }, - { - "id": "1f324b9b-a8a8-43b9-9c34-2207a3ea75a5", - "type": "3676a00f3a70e406487ed14b901daf3e4984e63d", - "position": { - "x": 432, - "y": -64 - }, - "size": { - "width": 96, - "height": 64 - } - }, - { - "id": "5c5222ea-6e9c-481a-8115-6193c3d80b91", - "type": "8a23ffd0491010ff595493182b82c722bd6902d7", - "position": { - "x": 600, - "y": -80 - }, - "size": { - "width": 96, - "height": 96 - } - }, - { - "id": "f1fe976c-6ec3-416a-9f98-8201127ad477", - "type": "basic.info", - "data": { - "info": "Change the current \noutput", - "readonly": true - }, - "position": { - "x": 408, - "y": -120 - }, - "size": { - "width": 168, - "height": 48 - } - } - ], - "wires": [ - { - "source": { - "block": "ca7c5f10-efb6-43f9-9364-52d751fc0bc6", - "port": "out" - }, - "target": { - "block": "0a772657-8018-424d-8f04-75d3ffff3692", - "port": "inlabel" - }, - "vertices": [] - }, - { - "source": { - "block": "b9359b10-b14f-4dd7-adf9-3f4f22bc65e6", - "port": "outlabel" - }, - "target": { - "block": "5c5222ea-6e9c-481a-8115-6193c3d80b91", - "port": "df0c1bb1-f8ef-49f3-b71f-9384c29a9735" - } - }, - { - "source": { - "block": "fcbd52d3-d1b8-4cd4-befc-e045d20b91e4", - "port": "out" - }, - "target": { - "block": "81f5e1f9-e867-4639-98b5-e12f7551751d", - "port": "inlabel" - } - }, - { - "source": { - "block": "a66e0e19-f794-47df-b52e-c663ff7fa3e2", - "port": "outlabel" - }, - "target": { - "block": "5c5222ea-6e9c-481a-8115-6193c3d80b91", - "port": "58d2c88e-2434-438f-986b-0f5b9c3654ca" - } - }, - { - "source": { - "block": "6289de91-cf70-4c94-af49-303c69b742b4", - "port": "outlabel" - }, - "target": { - "block": "4e8afe74-8f38-4873-97ee-f7585d99a4aa", - "port": "in" - } - }, - { - "source": { - "block": "f20a4359-8546-4dda-aa5c-d08bfe4724a0", - "port": "outlabel" - }, - "target": { - "block": "1f324b9b-a8a8-43b9-9c34-2207a3ea75a5", - "port": "18c2ebc7-5152-439c-9b3f-851c59bac834" - } - }, - { - "source": { - "block": "5c5222ea-6e9c-481a-8115-6193c3d80b91", - "port": "4e8afe74-8f38-4873-97ee-f7585d99a4aa" - }, - "target": { - "block": "8f321a4f-979f-46f9-b40f-524e6bc0008a", - "port": "inlabel" - } - }, - { - "source": { - "block": "915bebf3-8f1a-4547-8056-fe3e75c77022", - "port": "constant-out" - }, - "target": { - "block": "5c5222ea-6e9c-481a-8115-6193c3d80b91", - "port": "be33796a-a109-4ab0-a53b-dd6ec67587cd" - } - }, - { - "source": { - "block": "1f324b9b-a8a8-43b9-9c34-2207a3ea75a5", - "port": "664caf9e-5f40-4df4-800a-b626af702e62" - }, - "target": { - "block": "5c5222ea-6e9c-481a-8115-6193c3d80b91", - "port": "adf3a6ae-71e2-43dd-b504-c2cdbc14dab7" - } - } - ] - } - } - }, - "8a23ffd0491010ff595493182b82c722bd6902d7": { - "package": { - "name": "DFF-verilog", - "version": "0.2", - "description": "DFF. D Flip-flop. Verilog implementation", - "author": "Juan González-Gómez (Obijuan)", - "image": "%3Csvg%20xmlns=%22http://www.w3.org/2000/svg%22%20width=%22216.379%22%20height=%22279.911%22%20viewBox=%220%200%2057.25032%2074.059853%22%3E%3Cg%20stroke=%22#000%22%20stroke-width=%221.442%22%20stroke-linecap=%22round%22%20stroke-linejoin=%22round%22%3E%3Cpath%20d=%22M41.506%2040.152l13.608%2016.672-6.918-20.534%22%20fill=%22#ccc%22%20stroke-width=%221.0924880399999999%22/%3E%3Cpath%20d=%22M34.122%2032.088L24.89%2012.475l-6.45%203.724-2.07-3.583L37.276.546l2.07%203.584-6.093%203.517%2012.03%2018.223s5.4-2.025%208.536.74c3.136%202.766%202.52%204.92%202.887%204.772L33.017%2045.02s-2.849-3.695-2.16-6.795c.687-3.1%203.265-6.137%203.265-6.137z%22%20fill=%22red%22%20stroke-width=%221.0924880399999999%22/%3E%3C/g%3E%3Cg%20transform=%22translate(-93.518%20-22.665)%20scale(1.09073)%22%20stroke=%22green%22%20stroke-linecap=%22round%22%3E%3Ccircle%20cx=%22100.602%22%20cy=%2273.815%22%20r=%2214.559%22%20fill=%22#ececec%22%20stroke-width=%22.608%22%20stroke-linejoin=%22round%22/%3E%3Cpath%20d=%22M106.978%2082.142h-3.353V63.316H97.54v18.678h-3.652%22%20fill=%22none%22%20stroke-width=%221.521%22/%3E%3C/g%3E%3C/svg%3E", - "otid": 1594812046378 - }, - "design": { - "graph": { - "blocks": [ - { - "id": "df0c1bb1-f8ef-49f3-b71f-9384c29a9735", - "type": "basic.input", - "data": { - "name": "", - "clock": true - }, - "position": { - "x": 128, - "y": 424 - } - }, - { - "id": "adf3a6ae-71e2-43dd-b504-c2cdbc14dab7", - "type": "basic.input", - "data": { - "name": "d", - "clock": false - }, - "position": { - "x": 128, - "y": 536 - } - }, - { - "id": "4e8afe74-8f38-4873-97ee-f7585d99a4aa", - "type": "basic.output", - "data": { - "name": "" - }, - "position": { - "x": 824, - "y": 536 - } - }, - { - "id": "58d2c88e-2434-438f-986b-0f5b9c3654ca", - "type": "basic.input", - "data": { - "name": "load", - "clock": false - }, - "position": { - "x": 128, - "y": 648 - } - }, - { - "id": "be33796a-a109-4ab0-a53b-dd6ec67587cd", - "type": "basic.constant", - "data": { - "name": "", - "value": "0", - "local": false - }, - "position": { - "x": 488, - "y": 280 + "x": 624, + "y": -248 } }, { - "id": "5bffd6ef-bb9d-4d3f-a4f0-f91c6040ddc5", + "id": "60198e6c-e8ec-433b-a4fb-55bed9afcc45", "type": "basic.code", "data": { "ports": { @@ -10639,10 +10321,7 @@ "name": "clk" }, { - "name": "d" - }, - { - "name": "load" + "name": "t" } ], "out": [ @@ -10656,68 +10335,58 @@ "name": "INI" } ], - "code": "//-- Initial value\nreg qi = INI;\n\nalways @(posedge clk)\nbegin\n \n //-- When load is active\n //-- the input data is captured\n if (load == 1'b1)\n qi <= d;\n \nend\n\n//-- Connect the register with the\n//-- output\nassign q = qi;\n" + "code": "//-- Initial value\nreg qi = INI;\n\nalways @(posedge clk)\nbegin\n \n //-- check the toogle input\n if (t == 1'b1)\n qi <= ~ qi;\n \nend\n\n//-- Connect the register with the\n//-- output\nassign q = qi;\n" }, "position": { - "x": 320, - "y": 400 + "x": 496, + "y": -120 }, "size": { - "width": 424, - "height": 336 + "width": 352, + "height": 288 } } ], "wires": [ { "source": { - "block": "df0c1bb1-f8ef-49f3-b71f-9384c29a9735", - "port": "out" + "block": "915bebf3-8f1a-4547-8056-fe3e75c77022", + "port": "constant-out" }, "target": { - "block": "5bffd6ef-bb9d-4d3f-a4f0-f91c6040ddc5", - "port": "clk" + "block": "60198e6c-e8ec-433b-a4fb-55bed9afcc45", + "port": "INI" } }, { "source": { - "block": "adf3a6ae-71e2-43dd-b504-c2cdbc14dab7", + "block": "ca7c5f10-efb6-43f9-9364-52d751fc0bc6", "port": "out" }, "target": { - "block": "5bffd6ef-bb9d-4d3f-a4f0-f91c6040ddc5", - "port": "d" + "block": "60198e6c-e8ec-433b-a4fb-55bed9afcc45", + "port": "clk" } }, { "source": { - "block": "58d2c88e-2434-438f-986b-0f5b9c3654ca", + "block": "fcbd52d3-d1b8-4cd4-befc-e045d20b91e4", "port": "out" }, "target": { - "block": "5bffd6ef-bb9d-4d3f-a4f0-f91c6040ddc5", - "port": "load" + "block": "60198e6c-e8ec-433b-a4fb-55bed9afcc45", + "port": "t" } }, { "source": { - "block": "5bffd6ef-bb9d-4d3f-a4f0-f91c6040ddc5", + "block": "60198e6c-e8ec-433b-a4fb-55bed9afcc45", "port": "q" }, "target": { "block": "4e8afe74-8f38-4873-97ee-f7585d99a4aa", "port": "in" } - }, - { - "source": { - "block": "be33796a-a109-4ab0-a53b-dd6ec67587cd", - "port": "constant-out" - }, - "target": { - "block": "5bffd6ef-bb9d-4d3f-a4f0-f91c6040ddc5", - "port": "INI" - } } ] } diff --git a/wiki/images/tff-12.png b/wiki/images/tff-12.png index b9325a5..7adc28b 100644 Binary files a/wiki/images/tff-12.png and b/wiki/images/tff-12.png differ