[{"data":1,"prerenderedAt":-1},["ShallowReactive",2],{"doc-seo-700356-105":3,"detail-sidebar-cat-0-en-105":81,"doc-detail-700356-en":130,"doc-similar-700356":162},{"code":4,"msg":5,"data":6},0,"ok",{"site_id":7,"language":8,"slug":9,"title":10,"keywords":11,"description":12,"schema_data":13,"social_meta":74,"head_meta":76,"extra_data":78,"updated_unix":80},105,"en","implementing-state-machines-with-psoc-3-psoc-4-and-psoc-5lp","Implementing State Machines with PSoC 3, PSoC 4, and PSoC 5LP","","Explains how to implement finite state machines on the PSoC 3/PSoC 4/PSoC 5LP family using the PSoC Creator LUT component. Covers both Moore and Mealy implementations, including a rising edge detector example for Moore machines and a Mealy rising edge detector example. Provides step-by-step mapping from state transition and output definitions into LUT entries, discusses testing of included example projects, and compares multiple LUT mapping methods.",{"@graph":14,"@context":73},[15,34,56],{"@type":16,"itemListElement":17},"BreadcrumbList",[18,23,27,31],{"item":19,"name":20,"@type":21,"position":22},"https://docshare.wps.com","Home","ListItem",1,{"item":24,"name":25,"@type":21,"position":26},"https://docshare.wps.com/document/","Document",2,{"item":28,"name":29,"@type":21,"position":30},"https://docshare.wps.com/document/technology/","Technology",3,{"item":32,"name":10,"@type":21,"position":33},"https://docshare.wps.com/document/implementing-state-machines-with-psoc-3-psoc-4-and-psoc-5lp/700356/",4,{"url":32,"name":10,"@type":35,"image":36,"author":41,"headline":10,"publisher":44,"fileFormat":47,"inLanguage":8,"description":12,"dateModified":48,"datePublished":49,"encodingFormat":47,"isAccessibleForFree":50,"interactionStatistic":51},"DigitalDocument",{"url":37,"@type":38,"width":39,"height":40},"https://docshare.wps.com/thumbnails/implementing-state-machines-with-psoc-3-psoc-4-and-psoc-5lp/700356.png","ImageObject",300,407,{"name":42,"@type":43},"WPS_1786070896","Person",{"url":19,"name":45,"@type":46},"DocShare","Organization","application/pdf","2026-11-23","2026-11-12",true,{"@type":52,"interactionType":53,"userInteractionCount":55},"InteractionCounter",{"@type":54},"ViewAction",5,{"@type":57,"mainEntity":58},"FAQPage",[59,65,69],{"name":60,"@type":61,"acceptedAnswer":62},"What is the difference between Mealy and Moore state machines in this note?","Question",{"text":63,"@type":64},"Mealy outputs depend on both the present state and the input, while Moore outputs depend only on the present state. The note uses this distinction to show how each type can be implemented using LUT routing and registered outputs.","Answer",{"name":66,"@type":61,"acceptedAnswer":67},"How can a Moore state machine be implemented using a single LUT component?",{"text":68,"@type":64},"The note describes registering LUT outputs and routing outputs back to inputs, then mapping state transition and output requirements into LUT entries. It includes a step-by-step procedure using state values, input combinations, and a state transition table.",{"name":70,"@type":61,"acceptedAnswer":71},"How does the note handle testing and method comparison?",{"text":72,"@type":64},"It provides instructions for testing the example projects and then compares Method 1, Method 2, and Method 3, followed by an additional Moore example using Method 4. This helps evaluate different LUT mapping approaches for correctness and behavior.","https://schema.org",{"og:url":32,"og:type":75,"og:title":10,"og:site_name":45,"og:description":12},"article",{"robots":77,"canonical":32},"index,follow",{"doc_id":79,"site_id":7},700356,1794518385,{"code":4,"msg":82,"data":83},"success",[84,88,92,96,100,104,109,114,119,122,126],{"id":22,"doc_module":4,"doc_module_name":25,"category_name":85,"show_sort_weight":86,"slug":87},"Story & Novel",90,"story-novel",{"id":26,"doc_module":4,"doc_module_name":25,"category_name":89,"show_sort_weight":90,"slug":91},"Literature",80,"literature",{"id":33,"doc_module":4,"doc_module_name":25,"category_name":93,"show_sort_weight":94,"slug":95},"Exam",70,"exam",{"id":55,"doc_module":4,"doc_module_name":25,"category_name":97,"show_sort_weight":98,"slug":99},"Comic",60,"comic",{"id":101,"doc_module":4,"doc_module_name":25,"category_name":29,"show_sort_weight":102,"slug":103},6,50,"technology",{"id":105,"doc_module":4,"doc_module_name":25,"category_name":106,"show_sort_weight":107,"slug":108},7,"Healthcare",40,"healthcare",{"id":110,"doc_module":4,"doc_module_name":25,"category_name":111,"show_sort_weight":112,"slug":113},8,"Research & Report",30,"research-report",{"id":115,"doc_module":4,"doc_module_name":25,"category_name":116,"show_sort_weight":117,"slug":118},9,"Religion & Spirituality",20,"religion-spirituality",{"id":117,"doc_module":4,"doc_module_name":25,"category_name":120,"show_sort_weight":117,"slug":121},"World Cup","world-cup",{"id":123,"doc_module":4,"doc_module_name":25,"category_name":124,"show_sort_weight":123,"slug":125},10,"Lifestyle","lifestyle",{"id":127,"doc_module":4,"doc_module_name":25,"category_name":128,"show_sort_weight":55,"slug":129},19,"General","general",{"code":4,"msg":82,"data":131},{"doc_id":79,"user_id":132,"nickname":42,"user_avatar":133,"doc_module":4,"category_id":101,"category_name":29,"doc_title":10,"doc_description":12,"doc_content":134,"file_id":135,"file_url":136,"file_type":137,"file_size":138,"view_count":55,"is_deleted":4,"is_public":22,"is_downloadable":22,"audit_status":22,"page_count":139,"language":140,"language_code":8,"site_id":7,"html_lang":8,"table_of_contents":141,"faqs":142,"seo_title":143,"seo_description":12,"update_tm":80,"read_time":144,"preview_page_count":33,"preview_urls":145},549768072016,"https://ap-avatar.wpscdn.com/davatar_155a257f0dc6eb9ab79c44ca47cae57d","AN62510  \nImplementing State Machines with PSoC® 3, PSoC 4 , and PSoC 5LP  \nAuthor: Jaya Kathuria and Chris Keeser  \nAssociated Project: Yes  \nAssociated Part Family: PSoC 3, PSoC 4, PSoC 5  \nSoftware Version: PSoC Creator™ 4.0 SP1 and higher  \nRelated Application Notes: None  \nThis application note explains the method to implement state machines using the PSoC® 3/PSoC 4/PSoC 5LP family of devices. Mealy and Moore state machine implementations are shown with associated projects.  \nContents  \nIntroduction ....................................................................... 1  \nDesigning State Machines with PSoC 3/PSoC 4/PSoC 5LP .................................................................................... 1  \nPSoC Creator Look Up Table (LUT) Component – Brief Description ................................................................... 1  \nMoore State Machine Implementation ..........................2  \nImplementing Moore State Machine using Single LUT Component ...................................................................2  \nMethod 1 ...........................................................................3  \nMapping the State Machine into LUT ...........................3  \nTesting the Example Project:........................................8  \nComparison of Method 1, Method 2, and Method 3 .....9  \nExample 2 – Method 4: Moore State Machine............11  \nMealy State Machine Implementation ........................13  \nExample 3: Rising Edge Detector – Mealy Implementation ........................................................... 14  \nSummary ......................................................................... 16  \nDocument History............................................................ 17  \nIntroduction  \nState machines are commonly used to implement decision making algorithms. State machines are used in applications where distinguishable states exist. A finite state machine (FSM) is based on the idea that a given system has a finite number of states. There are two types of FSMs (Mealy and Moore) that are distinguished by their output generation:  \n􀂃 A Mealy machine has outputs that depend on the state and the input.  \n􀂃 A Moore machine has outputs that depend only on the state.  \nThis application note shows you how to implement both Mealy and Moore state machines using the lookup table (LUT) component in PSoC Creator with the PSoC 3/PSoC 4/PSoC 5LP family of devices. Example projects are included.  \nDesigning State Machines with PSoC 3/PSoC 4/PSoC 5LP  \nPSoC Creator Look Up Table (LUT) Component – Brief Description  \nYou can use the LUT in applications where a particular input combination generates a specific set of outputs; that is, you can use the LUT to perform any logic function. The LUT can have five inputs and eight outputs.  \nYou can create state machines with a LUT by “registering the outputs” and routing some of the outputs back to the inputs.  \nNote that, the LUT is implemented using Universal Digital Blocks (UDB) . There are PSoC devices which do not have a UDB and will not be able to implement the LUT. Please refer the respective device datasheet for details.  \nMoore State Machine Implementation  \nThis section guides you through a step-by-step procedure on how to implement Moore state machines using one or more LUT components.  \nImplementing Moore State Machine using Single LUT Component  \nIn a Moore state machine, the output is the function of the present state. A rising edge detector is shown as an example here. The rising edge detector produces a single-cycle pulse each time its input goes high (a rising edge is detected) . Figure 1 shows the implementation of the Rising Edge Detector using a Moore state machine.  \nFigure 1. Rising Edge Detector – Moore State Machine  \nE=1 E=1  \nE=1  \nE=1  \nIllegal State  \nThis is a dummy state to complete the state transitions.  \nNote: The state machines should have minimum no. of state flops, because this minimizes the no. of illegal states. Th","cbCaio0RqmKQsXQw","https://ap.wps.com/l/cbCaio0RqmKQsXQw","pdf",1135059,18,"English","# Introduction\n# Designing State Machines with PSoC 3/PSoC 4/PSoC 5LP\n## PSoC Creator Look Up Table (LUT) Component – Brief Description\n## Moore State Machine Implementation\n## Implementing Moore State Machine using Single LUT Component\n## Mapping the State Machine into LUT\n## Testing the Example Project\n## Comparison of Method 1, Method 2, and Method 3\n## Example 2 – Method 4: Moore State Machine\n## Mealy State Machine Implementation\n## Example 3: Rising Edge Detector – Mealy Implementation\n# Summary\n# Document History","[{\"question\":\"What is the difference between Mealy and Moore state machines in this note?\",\"answer\":\"Mealy outputs depend on both the present state and the input, while Moore outputs depend only on the present state. The note uses this distinction to show how each type can be implemented using LUT routing and registered outputs.\"},{\"question\":\"How can a Moore state machine be implemented using a single LUT component?\",\"answer\":\"The note describes registering LUT outputs and routing outputs back to inputs, then mapping state transition and output requirements into LUT entries. It includes a step-by-step procedure using state values, input combinations, and a state transition table.\"},{\"question\":\"How does the note handle testing and method comparison?\",\"answer\":\"It provides instructions for testing the example projects and then compares Method 1, Method 2, and Method 3, followed by an additional Moore example using Method 4. This helps evaluate different LUT mapping approaches for correctness and behavior.\"}]","Implementing State Machines with PSoC 3, PSoC 4, and PSoC 5LP | PDF",45,[146,150,154,158],{"page_no":22,"url":147,"width":148,"height":149},"https://res-academy.cache.wpscdn.com/upload/kdocshare/2026-11-12/041ba19ad4785130ad20ba2c32b6a06e.webp",983,1272,{"page_no":26,"url":151,"width":152,"height":153},"https://res-academy.cache.wpscdn.com/upload/kdocshare/2026-11-12/8180245a9c5bf22fab6d9bec78efec1c.webp",982,1270,{"page_no":30,"url":155,"width":156,"height":157},"https://res-academy.cache.wpscdn.com/upload/kdocshare/2026-11-12/bf132636651ab84e3d1267fc65360751.webp",981,1269,{"page_no":33,"url":159,"width":160,"height":161},"https://res-academy.cache.wpscdn.com/upload/kdocshare/2026-11-12/9d9a0a31dc7251cfead9a084dbc9d330.webp",980,1268,{"list":163,"token":11},[164,170,176,182,188,194,200,206,212,218],{"doc_id":165,"doc_title":166,"file_type":137,"home_preview_img_url":167,"slug":168,"view_count":55,"category_name":29,"create_tm":169},655605,"Mealy and Moore State Diagrams - Sequence Detector Design","https://weboffice-temporary-prod-sg.obs.ap-southeast-3.myhuaweicloud.com:443/export/thumbnail/export/thumbnail/110229975286063/last/300/407?AWSAccessKeyId=HPUAE6OPDRI9QZXR6WJG&Expires=1796162999&Signature=ad3Yv0Qf%2FTN53iJnvSlYMDJT9bE%3D","mealy-and-moore-state-diagrams-sequence-detector-design",1792962854,{"doc_id":171,"doc_title":172,"file_type":137,"home_preview_img_url":173,"slug":174,"view_count":33,"category_name":29,"create_tm":175},700351,"PSoC® Creator™ Release Notes - Version 3.0 - Update Guide","https://weboffice-temporary-prod-sg.obs.ap-southeast-3.myhuaweicloud.com:443/export/thumbnail/export/thumbnail/110230011565220/last/300/407?AWSAccessKeyId=HPUAE6OPDRI9QZXR6WJG&Expires=1796162999&Signature=jw9S%2FzilUPzLzJ%2BwBhCygwxGekA%3D","psoc-creator-release-notes-version-30-update-guide",1794518376,{"doc_id":177,"doc_title":178,"file_type":137,"home_preview_img_url":179,"slug":180,"view_count":30,"category_name":29,"create_tm":181},732125,"AN82250 - PSoC PLD Programmable Logic Designs with Verilog - Implementation","https://weboffice-temporary-prod-sg.obs.ap-southeast-3.myhuaweicloud.com:443/export/thumbnail/export/thumbnail/110230031765259/last/300/407?AWSAccessKeyId=HPUAE6OPDRI9QZXR6WJG&Expires=1796162999&Signature=IR1%2FmyQbNmj5S8fDqAm2CFUZMGI%3D","an82250-psoc-pld-programmable-logic-designs-with-verilog-implementation",1795378441,{"doc_id":183,"doc_title":184,"file_type":137,"home_preview_img_url":185,"slug":186,"view_count":55,"category_name":29,"create_tm":187},691504,"Getting Started with PSoC 5LP","https://weboffice-temporary-prod-sg.obs.ap-southeast-3.myhuaweicloud.com:443/export/thumbnail/export/thumbnail/110230002678526/last/300/407?AWSAccessKeyId=HPUAE6OPDRI9QZXR6WJG&Expires=1796162999&Signature=rbJcufv1z%2BwBYa69cECG0AEpyqM%3D","getting-started-with-psoc-5lp",1794174783,{"doc_id":189,"doc_title":190,"file_type":137,"home_preview_img_url":191,"slug":192,"view_count":26,"category_name":29,"create_tm":193},732124,"PSoC 5LP Development Kit Guide - CY8CKIT-050","https://weboffice-temporary-prod-sg.obs.ap-southeast-3.myhuaweicloud.com:443/export/thumbnail/export/thumbnail/110230031765254/last/300/407?AWSAccessKeyId=HPUAE6OPDRI9QZXR6WJG&Expires=1796162999&Signature=YvbWqRiU6Lvx9Sxis5d6kWzqUf4%3D","psoc-5lp-development-kit-guide-cy8ckit-050",1795378439,{"doc_id":195,"doc_title":196,"file_type":137,"home_preview_img_url":197,"slug":198,"view_count":105,"category_name":29,"create_tm":199},691508,"PSoC® 5LP Prototyping Kit Guide - Guide","https://weboffice-temporary-prod-sg.obs.ap-southeast-3.myhuaweicloud.com:443/export/thumbnail/export/thumbnail/110230002048627/last/300/407?AWSAccessKeyId=HPUAE6OPDRI9QZXR6WJG&Expires=1796162999&Signature=BcPf0NYCm7agr%2FyYn2%2FAqwCT2nU%3D","psoc-5lp-prototyping-kit-guide-guide",1794174792,{"doc_id":201,"doc_title":202,"file_type":137,"home_preview_img_url":203,"slug":204,"view_count":55,"category_name":29,"create_tm":205},700352,"PSoC 5LP Development Kit Guide - Doc. # 001-65816 Rev. E","https://weboffice-temporary-prod-sg.obs.ap-southeast-3.myhuaweicloud.com:443/export/thumbnail/export/thumbnail/110230011565217/last/300/407?AWSAccessKeyId=HPUAE6OPDRI9QZXR6WJG&Expires=1796162999&Signature=KEHbNcHngw%2FAB75eqMwV%2BKZkxYM%3D","psoc-5lp-development-kit-guide-doc-001-65816-rev-e",1794518377,{"doc_id":207,"doc_title":208,"file_type":137,"home_preview_img_url":209,"slug":210,"view_count":105,"category_name":29,"create_tm":211},692058,"PSoC™ 4200M - Datasheet - English","https://weboffice-temporary-prod-sg.obs.ap-southeast-3.myhuaweicloud.com:443/export/thumbnail/export/thumbnail/110230002893516/last/300/407?AWSAccessKeyId=HPUAE6OPDRI9QZXR6WJG&Expires=1796162999&Signature=i5qy3zM8uBYxiyhgbaMs%2FnuiNtE%3D","psoc-4200m-datasheet-english",1794178064,{"doc_id":213,"doc_title":214,"file_type":137,"home_preview_img_url":215,"slug":216,"view_count":33,"category_name":29,"create_tm":217},690282,"Low-Power Proximity CapSense Code Example - Infineon PSoC 4 - PSoC Creator 4.2","https://weboffice-temporary-prod-sg.obs.ap-southeast-3.myhuaweicloud.com:443/export/thumbnail/export/thumbnail/110230002013281/last/300/407?AWSAccessKeyId=HPUAE6OPDRI9QZXR6WJG&Expires=1796162999&Signature=PDyq%2BTZYGJXCogTtACrzWktnAyI%3D","low-power-proximity-capsense-code-example-infineon-psoc-4-psoc-creator-42",1794161398,{"doc_id":219,"doc_title":220,"file_type":137,"home_preview_img_url":221,"slug":222,"view_count":115,"category_name":29,"create_tm":223},655596,"State Diagram - Basic Concepts and How to Draw It","https://weboffice-temporary-prod-sg.obs.ap-southeast-3.myhuaweicloud.com:443/export/thumbnail/export/thumbnail/110229975286018/last/300/407?AWSAccessKeyId=HPUAE6OPDRI9QZXR6WJG&Expires=1796162999&Signature=FobFYiG3o5OULylY1disw6Fp3dM%3D","state-diagram-basic-concepts-and-how-to-draw-it",1792962828]