OpenCores
URL https://opencores.org/ocsvn/zx_ula/zx_ula/trunk

Subversion Repositories zx_ula

Compare Revisions

  • This comparison shows the changes necessary to convert path
    /
    from Rev 9 to Rev 10
    Reverse comparison

Rev 9 → Rev 10

/zx_ula/branches/xilinx/spectrum_48k_for_digilent_spartan3_starter_kit_with_ps2_keyboard/zx_spectrum_48k.xise
0,0 → 1,390
<?xml version="1.0" encoding="UTF-8" standalone="no" ?>
<project xmlns="http://www.xilinx.com/XMLSchema" xmlns:xil_pn="http://www.xilinx.com/XMLSchema">
 
<header>
<!-- ISE source project file created by Project Navigator. -->
<!-- -->
<!-- This file contains project source information including a list of -->
<!-- project source files, project and process properties. This file, -->
<!-- along with the project source files, is sufficient to open and -->
<!-- implement in ISE Project Navigator. -->
<!-- -->
<!-- Copyright (c) 1995-2010 Xilinx, Inc. All rights reserved. -->
</header>
 
<version xil_pn:ise_version="12.4" xil_pn:schema_version="2"/>
 
<files>
<file xil_pn:name="master_clock.v" xil_pn:type="FILE_VERILOG">
<association xil_pn:name="BehavioralSimulation"/>
<association xil_pn:name="Implementation"/>
</file>
<file xil_pn:name="ram.v" xil_pn:type="FILE_VERILOG">
<association xil_pn:name="BehavioralSimulation"/>
<association xil_pn:name="Implementation"/>
</file>
<file xil_pn:name="rom.v" xil_pn:type="FILE_VERILOG">
<association xil_pn:name="BehavioralSimulation"/>
<association xil_pn:name="Implementation"/>
</file>
<file xil_pn:name="sp48k_for_spartan3_starter_kit.ucf" xil_pn:type="FILE_UCF">
<association xil_pn:name="Implementation"/>
</file>
<file xil_pn:name="spectrum48k_tld.v" xil_pn:type="FILE_VERILOG">
<association xil_pn:name="BehavioralSimulation"/>
<association xil_pn:name="Implementation"/>
</file>
<file xil_pn:name="tv80_alu.v" xil_pn:type="FILE_VERILOG">
<association xil_pn:name="BehavioralSimulation"/>
<association xil_pn:name="Implementation"/>
</file>
<file xil_pn:name="tv80_core.v" xil_pn:type="FILE_VERILOG">
<association xil_pn:name="BehavioralSimulation"/>
<association xil_pn:name="Implementation"/>
</file>
<file xil_pn:name="tv80_mcode.v" xil_pn:type="FILE_VERILOG">
<association xil_pn:name="BehavioralSimulation"/>
<association xil_pn:name="Implementation"/>
</file>
<file xil_pn:name="tv80_reg.v" xil_pn:type="FILE_VERILOG">
<association xil_pn:name="BehavioralSimulation"/>
<association xil_pn:name="Implementation"/>
</file>
<file xil_pn:name="tv80n.v" xil_pn:type="FILE_VERILOG">
<association xil_pn:name="BehavioralSimulation"/>
<association xil_pn:name="Implementation"/>
</file>
<file xil_pn:name="ula.v" xil_pn:type="FILE_VERILOG">
<association xil_pn:name="BehavioralSimulation"/>
<association xil_pn:name="Implementation"/>
</file>
<file xil_pn:name="teclado_ps2.v" xil_pn:type="FILE_VERILOG">
<association xil_pn:name="BehavioralSimulation"/>
<association xil_pn:name="Implementation"/>
</file>
<file xil_pn:name="display.v" xil_pn:type="FILE_VERILOG">
<association xil_pn:name="BehavioralSimulation"/>
<association xil_pn:name="Implementation"/>
</file>
<file xil_pn:name="ps2controller.v" xil_pn:type="FILE_VERILOG">
<association xil_pn:name="BehavioralSimulation"/>
<association xil_pn:name="Implementation"/>
</file>
<file xil_pn:name="audio_management.v" xil_pn:type="FILE_VERILOG">
<association xil_pn:name="BehavioralSimulation"/>
<association xil_pn:name="Implementation"/>
</file>
</files>
 
<properties>
<property xil_pn:name="Add I/O Buffers" xil_pn:value="true" xil_pn:valueState="default"/>
<property xil_pn:name="Allow Logic Optimization Across Hierarchy" xil_pn:value="false" xil_pn:valueState="default"/>
<property xil_pn:name="Allow SelectMAP Pins to Persist" xil_pn:value="false" xil_pn:valueState="default"/>
<property xil_pn:name="Allow Unexpanded Blocks" xil_pn:value="false" xil_pn:valueState="default"/>
<property xil_pn:name="Allow Unmatched LOC Constraints" xil_pn:value="false" xil_pn:valueState="default"/>
<property xil_pn:name="Allow Unmatched Timing Group Constraints" xil_pn:value="false" xil_pn:valueState="default"/>
<property xil_pn:name="Asynchronous To Synchronous" xil_pn:value="false" xil_pn:valueState="default"/>
<property xil_pn:name="Auto Implementation Compile Order" xil_pn:value="true" xil_pn:valueState="default"/>
<property xil_pn:name="Auto Implementation Top" xil_pn:value="true" xil_pn:valueState="default"/>
<property xil_pn:name="Automatic BRAM Packing" xil_pn:value="false" xil_pn:valueState="default"/>
<property xil_pn:name="Automatically Insert glbl Module in the Netlist" xil_pn:value="true" xil_pn:valueState="default"/>
<property xil_pn:name="Automatically Run Generate Target PROM/ACE File" xil_pn:value="false" xil_pn:valueState="default"/>
<property xil_pn:name="BRAM Utilization Ratio" xil_pn:value="100" xil_pn:valueState="default"/>
<property xil_pn:name="Bring Out Global Set/Reset Net as a Port" xil_pn:value="false" xil_pn:valueState="default"/>
<property xil_pn:name="Bring Out Global Tristate Net as a Port" xil_pn:value="false" xil_pn:valueState="default"/>
<property xil_pn:name="Bus Delimiter" xil_pn:value="&lt;>" xil_pn:valueState="default"/>
<property xil_pn:name="CLB Pack Factor Percentage" xil_pn:value="100" xil_pn:valueState="default"/>
<property xil_pn:name="Case" xil_pn:value="Maintain" xil_pn:valueState="default"/>
<property xil_pn:name="Case Implementation Style" xil_pn:value="None" xil_pn:valueState="default"/>
<property xil_pn:name="Change Device Speed To" xil_pn:value="-4" xil_pn:valueState="default"/>
<property xil_pn:name="Change Device Speed To Post Trace" xil_pn:value="-4" xil_pn:valueState="default"/>
<property xil_pn:name="Combinatorial Logic Optimization" xil_pn:value="false" xil_pn:valueState="default"/>
<property xil_pn:name="Compile EDK Simulation Library" xil_pn:value="true" xil_pn:valueState="default"/>
<property xil_pn:name="Compile SIMPRIM (Timing) Simulation Library" xil_pn:value="true" xil_pn:valueState="default"/>
<property xil_pn:name="Compile UNISIM (Functional) Simulation Library" xil_pn:value="true" xil_pn:valueState="default"/>
<property xil_pn:name="Compile XilinxCoreLib (CORE Generator) Simulation Library" xil_pn:value="true" xil_pn:valueState="default"/>
<property xil_pn:name="Compile for HDL Debugging" xil_pn:value="true" xil_pn:valueState="default"/>
<property xil_pn:name="Configuration Clk (Configuration Pins)" xil_pn:value="Pull Up" xil_pn:valueState="default"/>
<property xil_pn:name="Configuration Pin Done" xil_pn:value="Pull Up" xil_pn:valueState="default"/>
<property xil_pn:name="Configuration Pin HSWAPEN" xil_pn:value="Pull Up" xil_pn:valueState="default"/>
<property xil_pn:name="Configuration Pin M0" xil_pn:value="Pull Up" xil_pn:valueState="default"/>
<property xil_pn:name="Configuration Pin M1" xil_pn:value="Pull Up" xil_pn:valueState="default"/>
<property xil_pn:name="Configuration Pin M2" xil_pn:value="Pull Up" xil_pn:valueState="default"/>
<property xil_pn:name="Configuration Pin Program" xil_pn:value="Pull Up" xil_pn:valueState="default"/>
<property xil_pn:name="Configuration Rate" xil_pn:value="Default (6)" xil_pn:valueState="default"/>
<property xil_pn:name="Correlate Output to Input Design" xil_pn:value="false" xil_pn:valueState="default"/>
<property xil_pn:name="Create ASCII Configuration File" xil_pn:value="false" xil_pn:valueState="default"/>
<property xil_pn:name="Create Binary Configuration File" xil_pn:value="false" xil_pn:valueState="default"/>
<property xil_pn:name="Create Bit File" xil_pn:value="true" xil_pn:valueState="default"/>
<property xil_pn:name="Create I/O Pads from Ports" xil_pn:value="false" xil_pn:valueState="default"/>
<property xil_pn:name="Create IEEE 1532 Configuration File" xil_pn:value="false" xil_pn:valueState="default"/>
<property xil_pn:name="Create Logic Allocation File" xil_pn:value="false" xil_pn:valueState="default"/>
<property xil_pn:name="Create Mask File" xil_pn:value="false" xil_pn:valueState="default"/>
<property xil_pn:name="Create ReadBack Data Files" xil_pn:value="false" xil_pn:valueState="default"/>
<property xil_pn:name="Cross Clock Analysis" xil_pn:value="false" xil_pn:valueState="default"/>
<property xil_pn:name="Custom Waveform Configuration File Behav" xil_pn:value="ram_controller_chronogram.wcfg" xil_pn:valueState="non-default"/>
<property xil_pn:name="DCI Update Mode" xil_pn:value="As Required" xil_pn:valueState="default"/>
<property xil_pn:name="Decoder Extraction" xil_pn:value="true" xil_pn:valueState="default"/>
<property xil_pn:name="Delay Values To Be Read from SDF" xil_pn:value="Setup Time" xil_pn:valueState="default"/>
<property xil_pn:name="Device" xil_pn:value="xc3s200" xil_pn:valueState="non-default"/>
<property xil_pn:name="Device Family" xil_pn:value="Spartan3" xil_pn:valueState="non-default"/>
<property xil_pn:name="Device Speed Grade/Select ABS Minimum" xil_pn:value="-4" xil_pn:valueState="default"/>
<property xil_pn:name="Do Not Escape Signal and Instance Names in Netlist" xil_pn:value="false" xil_pn:valueState="default"/>
<property xil_pn:name="Done (Output Events)" xil_pn:value="Default (4)" xil_pn:valueState="default"/>
<property xil_pn:name="Drive Done Pin High" xil_pn:value="false" xil_pn:valueState="default"/>
<property xil_pn:name="Enable BitStream Compression" xil_pn:value="false" xil_pn:valueState="default"/>
<property xil_pn:name="Enable Cyclic Redundancy Checking (CRC)" xil_pn:value="true" xil_pn:valueState="default"/>
<property xil_pn:name="Enable Debugging of Serial Mode BitStream" xil_pn:value="false" xil_pn:valueState="default"/>
<property xil_pn:name="Enable Hardware Co-Simulation" xil_pn:value="false" xil_pn:valueState="default"/>
<property xil_pn:name="Enable Internal Done Pipe" xil_pn:value="false" xil_pn:valueState="default"/>
<property xil_pn:name="Enable Message Filtering" xil_pn:value="false" xil_pn:valueState="default"/>
<property xil_pn:name="Enable Outputs (Output Events)" xil_pn:value="Default (5)" xil_pn:valueState="default"/>
<property xil_pn:name="Equivalent Register Removal XST" xil_pn:value="true" xil_pn:valueState="default"/>
<property xil_pn:name="Exclude Compilation of Deprecated EDK Cores" xil_pn:value="true" xil_pn:valueState="default"/>
<property xil_pn:name="Exclude Compilation of EDK Sub-Libraries" xil_pn:value="false" xil_pn:valueState="default"/>
<property xil_pn:name="Extra Effort" xil_pn:value="None" xil_pn:valueState="default"/>
<property xil_pn:name="Extra Effort (Highest PAR level only)" xil_pn:value="None" xil_pn:valueState="default"/>
<property xil_pn:name="FPGA Start-Up Clock" xil_pn:value="CCLK" xil_pn:valueState="default"/>
<property xil_pn:name="FSM Encoding Algorithm" xil_pn:value="Auto" xil_pn:valueState="default"/>
<property xil_pn:name="FSM Style" xil_pn:value="LUT" xil_pn:valueState="default"/>
<property xil_pn:name="Filter Files From Compile Order" xil_pn:value="true" xil_pn:valueState="default"/>
<property xil_pn:name="Flatten Output Netlist" xil_pn:value="false" xil_pn:valueState="default"/>
<property xil_pn:name="Functional Model Target Language ArchWiz" xil_pn:value="Verilog" xil_pn:valueState="default"/>
<property xil_pn:name="Functional Model Target Language Coregen" xil_pn:value="Verilog" xil_pn:valueState="default"/>
<property xil_pn:name="Functional Model Target Language Schematic" xil_pn:value="Verilog" xil_pn:valueState="default"/>
<property xil_pn:name="Generate Architecture Only (No Entity Declaration)" xil_pn:value="false" xil_pn:valueState="default"/>
<property xil_pn:name="Generate Asynchronous Delay Report" xil_pn:value="false" xil_pn:valueState="default"/>
<property xil_pn:name="Generate Clock Region Report" xil_pn:value="false" xil_pn:valueState="default"/>
<property xil_pn:name="Generate Constraints Interaction Report" xil_pn:value="false" xil_pn:valueState="default"/>
<property xil_pn:name="Generate Constraints Interaction Report Post Trace" xil_pn:value="false" xil_pn:valueState="default"/>
<property xil_pn:name="Generate Datasheet Section" xil_pn:value="true" xil_pn:valueState="default"/>
<property xil_pn:name="Generate Datasheet Section Post Trace" xil_pn:value="true" xil_pn:valueState="default"/>
<property xil_pn:name="Generate Detailed MAP Report" xil_pn:value="false" xil_pn:valueState="default"/>
<property xil_pn:name="Generate Multiple Hierarchical Netlist Files" xil_pn:value="false" xil_pn:valueState="default"/>
<property xil_pn:name="Generate Post-Place &amp; Route Power Report" xil_pn:value="false" xil_pn:valueState="default"/>
<property xil_pn:name="Generate Post-Place &amp; Route Simulation Model" xil_pn:value="false" xil_pn:valueState="default"/>
<property xil_pn:name="Generate RTL Schematic" xil_pn:value="Yes" xil_pn:valueState="default"/>
<property xil_pn:name="Generate SAIF File for Power Optimization/Estimation Par" xil_pn:value="false" xil_pn:valueState="default"/>
<property xil_pn:name="Generate Testbench File" xil_pn:value="false" xil_pn:valueState="default"/>
<property xil_pn:name="Generate Timegroups Section" xil_pn:value="false" xil_pn:valueState="default"/>
<property xil_pn:name="Generate Timegroups Section Post Trace" xil_pn:value="false" xil_pn:valueState="default"/>
<property xil_pn:name="Generics, Parameters" xil_pn:value="" xil_pn:valueState="default"/>
<property xil_pn:name="Global Optimization Goal" xil_pn:value="AllClockNets" xil_pn:valueState="default"/>
<property xil_pn:name="Global Set/Reset Port Name" xil_pn:value="GSR_PORT" xil_pn:valueState="default"/>
<property xil_pn:name="Global Tristate Port Name" xil_pn:value="GTS_PORT" xil_pn:valueState="default"/>
<property xil_pn:name="Hierarchy Separator" xil_pn:value="/" xil_pn:valueState="default"/>
<property xil_pn:name="ISim UUT Instance Name" xil_pn:value="UUT" xil_pn:valueState="default"/>
<property xil_pn:name="Ignore User Timing Constraints Map" xil_pn:value="false" xil_pn:valueState="default"/>
<property xil_pn:name="Ignore User Timing Constraints Par" xil_pn:value="false" xil_pn:valueState="default"/>
<property xil_pn:name="Implementation Top" xil_pn:value="Module|tld_spartan3_sp48k" xil_pn:valueState="non-default"/>
<property xil_pn:name="Implementation Top File" xil_pn:value="spectrum48k_tld.v" xil_pn:valueState="non-default"/>
<property xil_pn:name="Implementation Top Instance Path" xil_pn:value="/tld_spartan3_sp48k" xil_pn:valueState="non-default"/>
<property xil_pn:name="Include 'uselib Directive in Verilog File" xil_pn:value="false" xil_pn:valueState="default"/>
<property xil_pn:name="Include SIMPRIM Models in Verilog File" xil_pn:value="false" xil_pn:valueState="default"/>
<property xil_pn:name="Include UNISIM Models in Verilog File" xil_pn:value="false" xil_pn:valueState="default"/>
<property xil_pn:name="Include sdf_annotate task in Verilog File" xil_pn:value="true" xil_pn:valueState="default"/>
<property xil_pn:name="Incremental Compilation" xil_pn:value="true" xil_pn:valueState="default"/>
<property xil_pn:name="Insert Buffers to Prevent Pulse Swallowing" xil_pn:value="true" xil_pn:valueState="default"/>
<property xil_pn:name="Instantiation Template Target Language Xps" xil_pn:value="Verilog" xil_pn:valueState="default"/>
<property xil_pn:name="JTAG Pin TCK" xil_pn:value="Pull Up" xil_pn:valueState="default"/>
<property xil_pn:name="JTAG Pin TDI" xil_pn:value="Pull Up" xil_pn:valueState="default"/>
<property xil_pn:name="JTAG Pin TDO" xil_pn:value="Pull Up" xil_pn:valueState="default"/>
<property xil_pn:name="JTAG Pin TMS" xil_pn:value="Pull Up" xil_pn:valueState="default"/>
<property xil_pn:name="Keep Hierarchy" xil_pn:value="No" xil_pn:valueState="default"/>
<property xil_pn:name="Language" xil_pn:value="VHDL" xil_pn:valueState="default"/>
<property xil_pn:name="Last Applied Goal" xil_pn:value="Balanced" xil_pn:valueState="default"/>
<property xil_pn:name="Last Applied Strategy" xil_pn:value="Xilinx Default (unlocked)" xil_pn:valueState="default"/>
<property xil_pn:name="Last Unlock Status" xil_pn:value="false" xil_pn:valueState="default"/>
<property xil_pn:name="Library for Verilog Sources" xil_pn:value="" xil_pn:valueState="default"/>
<property xil_pn:name="Logical Shifter Extraction" xil_pn:value="true" xil_pn:valueState="default"/>
<property xil_pn:name="Manual Implementation Compile Order" xil_pn:value="false" xil_pn:valueState="default"/>
<property xil_pn:name="Map Effort Level" xil_pn:value="High" xil_pn:valueState="default"/>
<property xil_pn:name="Map Slice Logic into Unused Block RAMs" xil_pn:value="false" xil_pn:valueState="default"/>
<property xil_pn:name="Max Fanout" xil_pn:value="500" xil_pn:valueState="default"/>
<property xil_pn:name="Maximum Number of Lines in Report" xil_pn:value="1000" xil_pn:valueState="default"/>
<property xil_pn:name="Maximum Signal Name Length" xil_pn:value="20" xil_pn:valueState="default"/>
<property xil_pn:name="Move First Flip-Flop Stage" xil_pn:value="true" xil_pn:valueState="default"/>
<property xil_pn:name="Move Last Flip-Flop Stage" xil_pn:value="true" xil_pn:valueState="default"/>
<property xil_pn:name="Multiplier Style" xil_pn:value="Auto" xil_pn:valueState="default"/>
<property xil_pn:name="Mux Extraction" xil_pn:value="Yes" xil_pn:valueState="default"/>
<property xil_pn:name="Mux Style" xil_pn:value="Auto" xil_pn:valueState="default"/>
<property xil_pn:name="Netlist Hierarchy" xil_pn:value="As Optimized" xil_pn:valueState="default"/>
<property xil_pn:name="Netlist Translation Type" xil_pn:value="Timestamp" xil_pn:valueState="default"/>
<property xil_pn:name="Number of Clock Buffers" xil_pn:value="8" xil_pn:valueState="default"/>
<property xil_pn:name="Number of Paths in Error/Verbose Report" xil_pn:value="3" xil_pn:valueState="default"/>
<property xil_pn:name="Number of Paths in Error/Verbose Report Post Trace" xil_pn:value="3" xil_pn:valueState="default"/>
<property xil_pn:name="Optimization Effort" xil_pn:value="High" xil_pn:valueState="non-default"/>
<property xil_pn:name="Optimization Goal" xil_pn:value="Speed" xil_pn:valueState="default"/>
<property xil_pn:name="Optimization Strategy (Cover Mode)" xil_pn:value="Speed" xil_pn:valueState="non-default"/>
<property xil_pn:name="Optimize Instantiated Primitives" xil_pn:value="false" xil_pn:valueState="default"/>
<property xil_pn:name="Other Bitgen Command Line Options" xil_pn:value="" xil_pn:valueState="default"/>
<property xil_pn:name="Other Compiler Options" xil_pn:value="" xil_pn:valueState="default"/>
<property xil_pn:name="Other Compiler Options Map" xil_pn:value="" xil_pn:valueState="default"/>
<property xil_pn:name="Other Compiler Options Par" xil_pn:value="" xil_pn:valueState="default"/>
<property xil_pn:name="Other Compiler Options Translate" xil_pn:value="" xil_pn:valueState="default"/>
<property xil_pn:name="Other Compxlib Command Line Options" xil_pn:value="" xil_pn:valueState="default"/>
<property xil_pn:name="Other Map Command Line Options" xil_pn:value="" xil_pn:valueState="default"/>
<property xil_pn:name="Other NETGEN Command Line Options" xil_pn:value="" xil_pn:valueState="default"/>
<property xil_pn:name="Other Ngdbuild Command Line Options" xil_pn:value="" xil_pn:valueState="default"/>
<property xil_pn:name="Other Place &amp; Route Command Line Options" xil_pn:value="" xil_pn:valueState="default"/>
<property xil_pn:name="Other Simulator Commands Behavioral" xil_pn:value="" xil_pn:valueState="default"/>
<property xil_pn:name="Other Simulator Commands Post-Map" xil_pn:value="" xil_pn:valueState="default"/>
<property xil_pn:name="Other Simulator Commands Post-Route" xil_pn:value="" xil_pn:valueState="default"/>
<property xil_pn:name="Other Simulator Commands Post-Translate" xil_pn:value="" xil_pn:valueState="default"/>
<property xil_pn:name="Other XPWR Command Line Options" xil_pn:value="" xil_pn:valueState="default"/>
<property xil_pn:name="Other XST Command Line Options" xil_pn:value="" xil_pn:valueState="default"/>
<property xil_pn:name="Output Extended Identifiers" xil_pn:value="false" xil_pn:valueState="default"/>
<property xil_pn:name="Output File Name" xil_pn:value="tld_spartan3_sp48k" xil_pn:valueState="default"/>
<property xil_pn:name="Overwrite Compiled Libraries" xil_pn:value="false" xil_pn:valueState="default"/>
<property xil_pn:name="Pack I/O Registers into IOBs" xil_pn:value="Auto" xil_pn:valueState="default"/>
<property xil_pn:name="Pack I/O Registers/Latches into IOBs" xil_pn:value="Off" xil_pn:valueState="default"/>
<property xil_pn:name="Package" xil_pn:value="ft256" xil_pn:valueState="default"/>
<property xil_pn:name="Perform Advanced Analysis" xil_pn:value="false" xil_pn:valueState="default"/>
<property xil_pn:name="Perform Advanced Analysis Post Trace" xil_pn:value="false" xil_pn:valueState="default"/>
<property xil_pn:name="Perform Timing-Driven Packing and Placement" xil_pn:value="false" xil_pn:valueState="default"/>
<property xil_pn:name="Place &amp; Route Effort Level (Overall)" xil_pn:value="High" xil_pn:valueState="default"/>
<property xil_pn:name="Place And Route Mode" xil_pn:value="Normal Place and Route" xil_pn:valueState="default"/>
<property xil_pn:name="Placer Effort Level (Overrides Overall Level)" xil_pn:value="None" xil_pn:valueState="default"/>
<property xil_pn:name="Port to be used" xil_pn:value="Auto - default" xil_pn:valueState="default"/>
<property xil_pn:name="Post Map Simulation Model Name" xil_pn:value="tld_spartan3_sp48k_map.v" xil_pn:valueState="default"/>
<property xil_pn:name="Post Place &amp; Route Simulation Model Name" xil_pn:value="tld_spartan3_sp48k_timesim.v" xil_pn:valueState="default"/>
<property xil_pn:name="Post Synthesis Simulation Model Name" xil_pn:value="tld_spartan3_sp48k_synthesis.v" xil_pn:valueState="default"/>
<property xil_pn:name="Post Translate Simulation Model Name" xil_pn:value="tld_spartan3_sp48k_translate.v" xil_pn:valueState="default"/>
<property xil_pn:name="Power Reduction Map" xil_pn:value="false" xil_pn:valueState="default"/>
<property xil_pn:name="Power Reduction Par" xil_pn:value="false" xil_pn:valueState="default"/>
<property xil_pn:name="Preferred Language" xil_pn:value="Verilog" xil_pn:valueState="default"/>
<property xil_pn:name="Priority Encoder Extraction" xil_pn:value="Yes" xil_pn:valueState="default"/>
<property xil_pn:name="Produce Advanced Verbose Report" xil_pn:value="false" xil_pn:valueState="default"/>
<property xil_pn:name="Produce Verbose Report" xil_pn:value="false" xil_pn:valueState="default"/>
<property xil_pn:name="Project Description" xil_pn:value="" xil_pn:valueState="default"/>
<property xil_pn:name="Property Specification in Project File" xil_pn:value="Store all values" xil_pn:valueState="default"/>
<property xil_pn:name="RAM Extraction" xil_pn:value="true" xil_pn:valueState="default"/>
<property xil_pn:name="RAM Style" xil_pn:value="Auto" xil_pn:valueState="default"/>
<property xil_pn:name="ROM Extraction" xil_pn:value="true" xil_pn:valueState="default"/>
<property xil_pn:name="ROM Style" xil_pn:value="Auto" xil_pn:valueState="default"/>
<property xil_pn:name="Read Cores" xil_pn:value="true" xil_pn:valueState="default"/>
<property xil_pn:name="Regenerate Core" xil_pn:value="Under Current Project Setting" xil_pn:valueState="default"/>
<property xil_pn:name="Register Balancing" xil_pn:value="No" xil_pn:valueState="default"/>
<property xil_pn:name="Register Duplication" xil_pn:value="Off" xil_pn:valueState="default"/>
<property xil_pn:name="Register Duplication Xst" xil_pn:value="true" xil_pn:valueState="default"/>
<property xil_pn:name="Release Write Enable (Output Events)" xil_pn:value="Default (6)" xil_pn:valueState="default"/>
<property xil_pn:name="Rename Design Instance in Testbench File to" xil_pn:value="UUT" xil_pn:valueState="default"/>
<property xil_pn:name="Rename Top Level Architecture To" xil_pn:value="Structure" xil_pn:valueState="default"/>
<property xil_pn:name="Rename Top Level Entity to" xil_pn:value="" xil_pn:valueState="default"/>
<property xil_pn:name="Rename Top Level Module To" xil_pn:value="" xil_pn:valueState="default"/>
<property xil_pn:name="Report Fastest Path(s) in Each Constraint" xil_pn:value="true" xil_pn:valueState="default"/>
<property xil_pn:name="Report Fastest Path(s) in Each Constraint Post Trace" xil_pn:value="true" xil_pn:valueState="default"/>
<property xil_pn:name="Report Paths by Endpoint" xil_pn:value="3" xil_pn:valueState="default"/>
<property xil_pn:name="Report Paths by Endpoint Post Trace" xil_pn:value="3" xil_pn:valueState="default"/>
<property xil_pn:name="Report Type" xil_pn:value="Verbose Report" xil_pn:valueState="default"/>
<property xil_pn:name="Report Type Post Trace" xil_pn:value="Verbose Report" xil_pn:valueState="default"/>
<property xil_pn:name="Report Unconstrained Paths" xil_pn:value="" xil_pn:valueState="default"/>
<property xil_pn:name="Report Unconstrained Paths Post Trace" xil_pn:value="" xil_pn:valueState="default"/>
<property xil_pn:name="Reset DCM if SHUTDOWN &amp; AGHIGH performed" xil_pn:value="false" xil_pn:valueState="default"/>
<property xil_pn:name="Reset On Configuration Pulse Width" xil_pn:value="100" xil_pn:valueState="default"/>
<property xil_pn:name="Resource Sharing" xil_pn:value="true" xil_pn:valueState="default"/>
<property xil_pn:name="Retain Hierarchy" xil_pn:value="true" xil_pn:valueState="default"/>
<property xil_pn:name="Router Effort Level (Overrides Overall Level)" xil_pn:value="None" xil_pn:valueState="default"/>
<property xil_pn:name="Run Design Rules Checker (DRC)" xil_pn:value="true" xil_pn:valueState="default"/>
<property xil_pn:name="Run for Specified Time" xil_pn:value="true" xil_pn:valueState="default"/>
<property xil_pn:name="Run for Specified Time Map" xil_pn:value="true" xil_pn:valueState="default"/>
<property xil_pn:name="Run for Specified Time Par" xil_pn:value="true" xil_pn:valueState="default"/>
<property xil_pn:name="Run for Specified Time Translate" xil_pn:value="true" xil_pn:valueState="default"/>
<property xil_pn:name="Safe Implementation" xil_pn:value="No" xil_pn:valueState="default"/>
<property xil_pn:name="Security" xil_pn:value="Enable Readback and Reconfiguration" xil_pn:valueState="default"/>
<property xil_pn:name="Selected Module Instance Name" xil_pn:value="/test_ram_controller" xil_pn:valueState="non-default"/>
<property xil_pn:name="Selected Simulation Root Source Node Behavioral" xil_pn:value="work.test_ram_controller" xil_pn:valueState="non-default"/>
<property xil_pn:name="Selected Simulation Root Source Node Post-Map" xil_pn:value="" xil_pn:valueState="default"/>
<property xil_pn:name="Selected Simulation Root Source Node Post-Route" xil_pn:value="" xil_pn:valueState="default"/>
<property xil_pn:name="Selected Simulation Root Source Node Post-Translate" xil_pn:value="" xil_pn:valueState="default"/>
<property xil_pn:name="Selected Simulation Source Node" xil_pn:value="UUT" xil_pn:valueState="default"/>
<property xil_pn:name="Shift Register Extraction" xil_pn:value="true" xil_pn:valueState="default"/>
<property xil_pn:name="Show All Models" xil_pn:value="false" xil_pn:valueState="default"/>
<property xil_pn:name="Simulation Model Target" xil_pn:value="Verilog" xil_pn:valueState="default"/>
<property xil_pn:name="Simulation Run Time ISim" xil_pn:value="6700 ns" xil_pn:valueState="non-default"/>
<property xil_pn:name="Simulation Run Time Map" xil_pn:value="1000 ns" xil_pn:valueState="default"/>
<property xil_pn:name="Simulation Run Time Par" xil_pn:value="1000 ns" xil_pn:valueState="default"/>
<property xil_pn:name="Simulation Run Time Translate" xil_pn:value="1000 ns" xil_pn:valueState="default"/>
<property xil_pn:name="Simulator" xil_pn:value="ISim (VHDL/Verilog)" xil_pn:valueState="default"/>
<property xil_pn:name="Slice Packing" xil_pn:value="true" xil_pn:valueState="default"/>
<property xil_pn:name="Slice Utilization Ratio" xil_pn:value="100" xil_pn:valueState="default"/>
<property xil_pn:name="Specify 'define Macro Name and Value" xil_pn:value="" xil_pn:valueState="default"/>
<property xil_pn:name="Specify Top Level Instance Names Behavioral" xil_pn:value="work.test_ram_controller" xil_pn:valueState="default"/>
<property xil_pn:name="Specify Top Level Instance Names Post-Map" xil_pn:value="Default" xil_pn:valueState="default"/>
<property xil_pn:name="Specify Top Level Instance Names Post-Route" xil_pn:value="Default" xil_pn:valueState="default"/>
<property xil_pn:name="Specify Top Level Instance Names Post-Translate" xil_pn:value="Default" xil_pn:valueState="default"/>
<property xil_pn:name="Speed Grade" xil_pn:value="-4" xil_pn:valueState="non-default"/>
<property xil_pn:name="Starting Placer Cost Table (1-100) Map" xil_pn:value="1" xil_pn:valueState="default"/>
<property xil_pn:name="Starting Placer Cost Table (1-100) Par" xil_pn:value="1" xil_pn:valueState="default"/>
<property xil_pn:name="Synthesis Tool" xil_pn:value="XST (VHDL/Verilog)" xil_pn:valueState="default"/>
<property xil_pn:name="Target Simulator" xil_pn:value="Please Specify" xil_pn:valueState="default"/>
<property xil_pn:name="Timing Mode Map" xil_pn:value="Non Timing Driven" xil_pn:valueState="default"/>
<property xil_pn:name="Timing Mode Par" xil_pn:value="Performance Evaluation" xil_pn:valueState="default"/>
<property xil_pn:name="Top-Level Module Name in Output Netlist" xil_pn:value="" xil_pn:valueState="default"/>
<property xil_pn:name="Top-Level Source Type" xil_pn:value="HDL" xil_pn:valueState="default"/>
<property xil_pn:name="Trim Unconnected Signals" xil_pn:value="true" xil_pn:valueState="default"/>
<property xil_pn:name="Tristate On Configuration Pulse Width" xil_pn:value="0" xil_pn:valueState="default"/>
<property xil_pn:name="Unused IOB Pins" xil_pn:value="Pull Down" xil_pn:valueState="default"/>
<property xil_pn:name="Use Clock Enable" xil_pn:value="Yes" xil_pn:valueState="default"/>
<property xil_pn:name="Use Custom Project File Behavioral" xil_pn:value="false" xil_pn:valueState="default"/>
<property xil_pn:name="Use Custom Project File Post-Map" xil_pn:value="false" xil_pn:valueState="default"/>
<property xil_pn:name="Use Custom Project File Post-Route" xil_pn:value="false" xil_pn:valueState="default"/>
<property xil_pn:name="Use Custom Project File Post-Translate" xil_pn:value="false" xil_pn:valueState="default"/>
<property xil_pn:name="Use Custom Simulation Command File Behavioral" xil_pn:value="false" xil_pn:valueState="default"/>
<property xil_pn:name="Use Custom Simulation Command File Map" xil_pn:value="false" xil_pn:valueState="default"/>
<property xil_pn:name="Use Custom Simulation Command File Par" xil_pn:value="false" xil_pn:valueState="default"/>
<property xil_pn:name="Use Custom Simulation Command File Translate" xil_pn:value="false" xil_pn:valueState="default"/>
<property xil_pn:name="Use Custom Waveform Configuration File Behav" xil_pn:value="true" xil_pn:valueState="non-default"/>
<property xil_pn:name="Use Custom Waveform Configuration File Map" xil_pn:value="false" xil_pn:valueState="default"/>
<property xil_pn:name="Use Custom Waveform Configuration File Par" xil_pn:value="false" xil_pn:valueState="default"/>
<property xil_pn:name="Use Custom Waveform Configuration File Translate" xil_pn:value="false" xil_pn:valueState="default"/>
<property xil_pn:name="Use LOC Constraints" xil_pn:value="true" xil_pn:valueState="default"/>
<property xil_pn:name="Use RLOC Constraints" xil_pn:value="Yes" xil_pn:valueState="default"/>
<property xil_pn:name="Use Smart Guide" xil_pn:value="false" xil_pn:valueState="default"/>
<property xil_pn:name="Use Synchronous Reset" xil_pn:value="Yes" xil_pn:valueState="default"/>
<property xil_pn:name="Use Synchronous Set" xil_pn:value="Yes" xil_pn:valueState="default"/>
<property xil_pn:name="Use Synthesis Constraints File" xil_pn:value="true" xil_pn:valueState="default"/>
<property xil_pn:name="User Browsed Strategy Files" xil_pn:value="" xil_pn:valueState="default"/>
<property xil_pn:name="UserID Code (8 Digit Hexadecimal)" xil_pn:value="0xFFFFFFFF" xil_pn:valueState="default"/>
<property xil_pn:name="VHDL Source Analysis Standard" xil_pn:value="VHDL-200X" xil_pn:valueState="non-default"/>
<property xil_pn:name="Value Range Check" xil_pn:value="false" xil_pn:valueState="default"/>
<property xil_pn:name="Verilog 2001 Xst" xil_pn:value="true" xil_pn:valueState="default"/>
<property xil_pn:name="Verilog Macros" xil_pn:value="" xil_pn:valueState="default"/>
<property xil_pn:name="Wait for DCI Match (Output Events) virtex2" xil_pn:value="Auto" xil_pn:valueState="default"/>
<property xil_pn:name="Wait for DLL Lock (Output Events)" xil_pn:value="Default (NoWait)" xil_pn:valueState="default"/>
<property xil_pn:name="Working Directory" xil_pn:value="." xil_pn:valueState="non-default"/>
<property xil_pn:name="Write Timing Constraints" xil_pn:value="false" xil_pn:valueState="default"/>
<property xil_pn:name="XOR Collapsing" xil_pn:value="true" xil_pn:valueState="default"/>
<!-- -->
<!-- The following properties are for internal use only. These should not be modified.-->
<!-- -->
<property xil_pn:name="PROP_BehavioralSimTop" xil_pn:value="Module|test_ram_controller" xil_pn:valueState="non-default"/>
<property xil_pn:name="PROP_DesignName" xil_pn:value="zx_spectrum_48k" xil_pn:valueState="non-default"/>
<property xil_pn:name="PROP_DevFamilyPMName" xil_pn:value="spartan3" xil_pn:valueState="default"/>
<property xil_pn:name="PROP_FPGAConfiguration" xil_pn:value="FPGAConfiguration" xil_pn:valueState="default"/>
<property xil_pn:name="PROP_PostMapSimTop" xil_pn:value="" xil_pn:valueState="default"/>
<property xil_pn:name="PROP_PostParSimTop" xil_pn:value="" xil_pn:valueState="default"/>
<property xil_pn:name="PROP_PostSynthSimTop" xil_pn:value="" xil_pn:valueState="default"/>
<property xil_pn:name="PROP_PostXlateSimTop" xil_pn:value="" xil_pn:valueState="default"/>
<property xil_pn:name="PROP_PreSynthesis" xil_pn:value="PreSynthesis" xil_pn:valueState="default"/>
<property xil_pn:name="PROP_intProjectCreationTimestamp" xil_pn:value="2012-04-24T12:50:54" xil_pn:valueState="non-default"/>
<property xil_pn:name="PROP_intWbtProjectID" xil_pn:value="44419C92BD2D457E847B96D98538FAD4" xil_pn:valueState="non-default"/>
<property xil_pn:name="PROP_intWorkingDirLocWRTProjDir" xil_pn:value="Same" xil_pn:valueState="non-default"/>
<property xil_pn:name="PROP_intWorkingDirUsed" xil_pn:value="No" xil_pn:valueState="non-default"/>
</properties>
 
<bindings/>
 
<libraries/>
 
<autoManagedFiles>
<!-- The following files are identified by `include statements in verilog -->
<!-- source files and are automatically managed by Project Navigator. -->
<!-- -->
<!-- Do not hand-edit this section, as it will be overwritten when the -->
<!-- project is analyzed based on files automatically identified as -->
<!-- include files. -->
<file xil_pn:name="mapa_es.inc" xil_pn:type="FILE_VERILOG"/>
</autoManagedFiles>
 
</project>
/zx_ula/branches/xilinx/spectrum_48k_for_digilent_spartan3_starter_kit_with_ps2_keyboard/sp48k_for_spartan3_starter_kit.ucf
0,0 → 1,80
NET "clk50" LOC = "T9" | IOSTANDARD = LVCMOS33;
# Define clock period for 50 MHz oscillator (40%/60% duty-cycle)
# NET "clk50" PERIOD = 20.0ns HIGH 40%;
 
NET "reset" LOC = "L14" | IOSTANDARD = LVCMOS33;
 
# I/O
NET "r" LOC = "E7" | IOSTANDARD = LVCMOS33;
NET "g" LOC = "D6" | IOSTANDARD = LVCMOS33;
NET "b" LOC = "D5" | IOSTANDARD = LVCMOS33;
NET "i" LOC = "D7" | IOSTANDARD = LVCMOS33;
 
NET "csync" LOC = "D8" | IOSTANDARD = LVCMOS33;
NET "audio_out" LOC = "D10" | IOSTANDARD = LVCMOS33;
NET "ear" LOC = "T13" | IOSTANDARD = LVCMOS33;
 
# Debug LED's
NET "ledclk" LOC = "P11" | IOSTANDARD = LVCMOS33;
NET "ledaux<3>" LOC = "P12" | IOSTANDARD = LVCMOS33;
NET "ledaux<2>" LOC = "N12" | IOSTANDARD = LVCMOS33;
NET "ledaux<1>" LOC = "P13" | IOSTANDARD = LVCMOS33;
NET "ledaux<0>" LOC = "N14" | IOSTANDARD = LVCMOS33;
 
# Keyboard connections
NET "clkps2" LOC = "M16" | IOSTANDARD = LVTTL | PULLUP;
#NET "clkps2" CLOCK_DEDICATED_ROUTE = FALSE;
NET "dataps2" LOC = "M15" | IOSTANDARD = LVTTL | PULLUP;
 
# 7-segment display connections and LED's (optional, for PS2 keyboard module)
NET "dispanodes<0>" LOC = "D14" | IOSTANDARD = LVCMOS33;
NET "dispanodes<1>" LOC = "G14" | IOSTANDARD = LVCMOS33;
NET "dispanodes<2>" LOC = "F14" | IOSTANDARD = LVCMOS33;
NET "dispanodes<3>" LOC = "E13" | IOSTANDARD = LVCMOS33;
 
NET "dispcathodes<6>" LOC = "E14" | IOSTANDARD = LVCMOS33;
NET "dispcathodes<5>" LOC = "G13" | IOSTANDARD = LVCMOS33;
NET "dispcathodes<4>" LOC = "N16" | IOSTANDARD = LVCMOS33;
NET "dispcathodes<3>" LOC = "F13" | IOSTANDARD = LVCMOS33;
NET "dispcathodes<2>" LOC = "N15" | IOSTANDARD = LVCMOS33;
NET "dispcathodes<1>" LOC = "P15" | IOSTANDARD = LVCMOS33;
NET "dispcathodes<0>" LOC = "R16" | IOSTANDARD = LVCMOS33;
 
NET "ledextended" LOC = "P14" | IOSTANDARD = LVCMOS33;
NET "ledreleased" LOC = "K12" | IOSTANDARD = LVCMOS33;
NET "ledshift" LOC = "L12" | IOSTANDARD = LVCMOS33;
 
# External SRAM
NET "sa<17>" LOC = "L3" | IOSTANDARD = LVCMOS33;
NET "sa<16>" LOC = "K5" | IOSTANDARD = LVCMOS33;
NET "sa<15>" LOC = "K3" | IOSTANDARD = LVCMOS33;
NET "sa<14>" LOC = "J3" | IOSTANDARD = LVCMOS33;
NET "sa<13>" LOC = "J4" | IOSTANDARD = LVCMOS33;
NET "sa<12>" LOC = "H4" | IOSTANDARD = LVCMOS33;
NET "sa<11>" LOC = "H3" | IOSTANDARD = LVCMOS33;
NET "sa<10>" LOC = "G5" | IOSTANDARD = LVCMOS33;
NET "sa<9>" LOC = "E4" | IOSTANDARD = LVCMOS33;
NET "sa<8>" LOC = "E3" | IOSTANDARD = LVCMOS33;
NET "sa<7>" LOC = "F4" | IOSTANDARD = LVCMOS33;
NET "sa<6>" LOC = "F3" | IOSTANDARD = LVCMOS33;
NET "sa<5>" LOC = "G4" | IOSTANDARD = LVCMOS33;
NET "sa<4>" LOC = "L4" | IOSTANDARD = LVCMOS33;
NET "sa<3>" LOC = "M3" | IOSTANDARD = LVCMOS33;
NET "sa<2>" LOC = "M4" | IOSTANDARD = LVCMOS33;
NET "sa<1>" LOC = "N3" | IOSTANDARD = LVCMOS33;
NET "sa<0>" LOC = "L5" | IOSTANDARD = LVCMOS33;
 
NET "sd1<7>" LOC = "B1" | IOSTANDARD = LVCMOS33;
NET "sd1<6>" LOC = "C1" | IOSTANDARD = LVCMOS33;
NET "sd1<5>" LOC = "C2" | IOSTANDARD = LVCMOS33;
NET "sd1<4>" LOC = "R5" | IOSTANDARD = LVCMOS33;
NET "sd1<3>" LOC = "T5" | IOSTANDARD = LVCMOS33;
NET "sd1<2>" LOC = "R6" | IOSTANDARD = LVCMOS33;
NET "sd1<1>" LOC = "T8" | IOSTANDARD = LVCMOS33;
NET "sd1<0>" LOC = "N7" | IOSTANDARD = LVCMOS33;
 
NET "sramce1" LOC = "P7" | IOSTANDARD = LVCMOS33;
NET "sramub1" LOC = "T4" | IOSTANDARD = LVCMOS33;
NET "sramlb1" LOC = "P6" | IOSTANDARD = LVCMOS33;
NET "sramwe" LOC = "G3" | IOSTANDARD = LVCMOS33;
NET "sramoe" LOC = "K4" | IOSTANDARD = LVCMOS33;
/zx_ula/branches/xilinx/spectrum_48k_for_digilent_spartan3_starter_kit_with_ps2_keyboard/ram.v
0,0 → 1,207
`timescale 1ns / 1ps
//////////////////////////////////////////////////////////////////////////////////
// Company: Dept. Architecture and Computing Technology. University of Seville
// Engineer: Miguel Angel Rodriguez Jodar. rodriguj@atc.us.es
//
// Create Date: 19:13:39 4-Apr-2012
// Design Name: ZX Spectrum
// Module Name: ram32k
// Project Name:
// Target Devices:
// Tool versions:
// Description:
//
// Dependencies:
//
// Revision:
// Revision 1.00 - File Created
// Additional Comments: GPL License policies apply to the contents of this file.
//
//////////////////////////////////////////////////////////////////////////////////
 
/*
This module generates a high level on "isfalling" when "a" changes from high to low.
*/
module getfedge (
input clk,
input a,
output isfalling
);
reg sh = 1'b1;
assign isfalling = sh & ~a;
always @(posedge clk)
sh <= a;
endmodule
 
 
/*
This module implements a shared RAM controller. The Spartan 3 Starter Kit has two 256Kx16 SRAM chips.
It uses half the size of one of these chips (8 bit data bus instead of 16).
As the ZX Spectrum needs two independent memory banks, and bus cycles may happen to both at the same
time, it's necessary to emulate those two banks with one chip.
 
I tried a simple round-robin multiplexing, but didn't work as expected. This module is a bit more complicated
as it implements a first-come-first-serve approach, with fixed priority scheme when several petitions happen
at the same time.
 
Each bank can be up to 64Kx8, so implementing a 128K memory scheme is very easy (I hope so) using this module
and the external SRAM on board.
 
This may be my first 100% synchronous implementation for a FPGA (that is, only one clock and all the ff's are
activated at the same edge)
 
*/
module ram_controller (
input clk,
// Bank 1 (VRAM)
input [15:0] a1,
input cs1_n,
input oe1_n,
input we1_n,
input [7:0] din1,
output [7:0] dout1,
// Bank 2 (upper RAM)
input [15:0] a2,
input cs2_n,
input oe2_n,
input we2_n,
input [7:0] din2,
output [7:0] dout2,
// Outputs to actual SRAM on board
output [17:0] sa,
inout [7:0] sd,
output sramce,
output sramub,
output sramlb,
output sramoe,
output sramwe
);
// Permanently enable SRAM and set it to use only LSB
assign sramub = 1;
assign sramlb = 0;
assign sramce = 0;
assign sramoe = 0;
reg rsramwe = 1;
assign sramwe = rsramwe;
reg [17:0] rsa;
reg [7:0] rsd;
assign sa = rsa;
assign sd = rsd;
 
// set when there has been a high to low transition in the corresponding signal
wire bank1read, bank1write, bank2read, bank2write;
getfedge detectbank1read (clk, cs1_n | oe1_n, bank1read);
getfedge detectbank2read (clk, cs2_n | oe2_n, bank2read);
getfedge detectbank1write (clk, cs1_n | we1_n, bank1write);
getfedge detectbank2write (clk, cs2_n | we2_n, bank2write);
 
reg [15:0] ra1;
reg [15:0] ra2;
reg [7:0] rdin1;
reg [7:0] rdin2;
reg [7:0] rdout1;
assign dout1 = rdout1;
reg [7:0] rdout2;
assign dout2 = rdout2;
 
// ff's to store pending memory requests
reg pendingreadb1 = 0;
reg pendingwriteb1 = 0;
reg pendingreadb2 = 0;
reg pendingwriteb2 = 0;
// ff's to store current memory requests
reg reqreadb1 = 0;
reg reqreadb2 = 0;
reg reqwriteb1 = 0;
reg reqwriteb2 = 0;
 
reg state = 1;
always @(posedge clk) begin
// get requests from the two banks
if (bank1read) begin
ra1 <= a1;
pendingreadb1 <= 1;
pendingwriteb1 <= 0;
end
else if (bank1write) begin
ra1 <= a1;
rdin1 <= din1;
pendingwriteb1 <= 1;
pendingreadb1 <= 0;
end
if (bank2read) begin
ra2 <= a2;
pendingreadb2 <= 1;
pendingwriteb2 <= 0;
end
else if (bank2write) begin
ra2 <= a2;
rdin2 <= din2;
pendingwriteb2 <= 1;
pendingreadb2 <= 0;
end
// reads from bank1 have the higher priority, then writes to bank1,
// the reads from bank2, then writes from bank2.
// Reads and writes to bank2 are mutually exclusive, though, as only the CPU
// performs those operations. So they are with respect to bank1.
case (state)
0 : begin
if (reqreadb1 || reqwriteb1) begin
rsa <= {2'b00,ra1}; // operation to bank1 accepted. We put the memory address on the SRAM address bus
if (reqwriteb1) begin // if this is a write operation...
pendingwriteb1 <= 0; // accept it, and mark pending operation as cleared
rsd <= rdin1; // put the data to be written in the SRAM data bus
rsramwe <= 0; // pulse /WE in SRAM to begin write
end
else begin
pendingreadb1 <= 0; // else, this is a read operation...
rsd <= 8'bzzzzzzzz; // disconnect the output bus from the data register to the SRAM data bus, so
rsramwe <= 1; // we can read from the SRAM data bus itself. Deassert /WE to enable data output bus
end
state <= 1; // if either request has been accepted, proceed to next phase.
end
else if (reqreadb2 || reqwriteb2) begin // do the same with requests to bank 2...
rsa <= {2'b01,ra2};
if (reqwriteb2) begin
pendingwriteb2 <= 0;
rsd <= rdin2;
rsramwe <= 0;
end
else begin
pendingreadb2 <= 0;
rsd <= 8'bzzzzzzzz;
rsramwe <= 1;
end
state <= 1;
end
end
1 : begin
if (reqreadb1) begin // for read requests, read the SRAM data bus and store into the corresponding data output register
rdout1 <= sd;
end
else if (reqreadb2) begin
rdout2 <= sd;
end
if (reqwriteb1) begin // for write requests, deassert /WE, as writting has already been happened.
rsramwe <= 1;
end
else if (reqwriteb2) begin
rsramwe <= 1;
end
reqreadb1 <= pendingreadb1; // current request has finished, so update current requests with pending requests to serve the next one
reqreadb2 <= pendingreadb2;
reqwriteb1 <= pendingwriteb1;
reqwriteb2 <= pendingwriteb2;
if (pendingreadb1 || pendingreadb2 || pendingwriteb1 || pendingwriteb2)
state <= 0;
end
endcase
end
endmodule
/zx_ula/branches/xilinx/spectrum_48k_for_digilent_spartan3_starter_kit_with_ps2_keyboard/tv80n.v
0,0 → 1,182
//
// TV80 8-Bit Microprocessor Core
// Based on the VHDL T80 core by Daniel Wallner (jesus@opencores.org)
//
// Copyright (c) 2004 Guy Hutchison (ghutchis@opencores.org)
//
// Permission is hereby granted, free of charge, to any person obtaining a
// copy of this software and associated documentation files (the "Software"),
// to deal in the Software without restriction, including without limitation
// the rights to use, copy, modify, merge, publish, distribute, sublicense,
// and/or sell copies of the Software, and to permit persons to whom the
// Software is furnished to do so, subject to the following conditions:
//
// The above copyright notice and this permission notice shall be included
// in all copies or substantial portions of the Software.
//
// THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND,
// EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF
// MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT.
// IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY
// CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT,
// TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE
// SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
 
// Negative-edge based wrapper allows memory wait_n signal to work
// correctly without resorting to asynchronous logic.
 
module tv80n (/*AUTOARG*/
// Outputs
m1_n, mreq_n, iorq_n, rd_n, wr_n, rfsh_n, halt_n, busak_n, A, dout,
// Inputs
reset_n, clk, wait_n, int_n, nmi_n, busrq_n, di
);
 
parameter Mode = 0; // 0 => Z80, 1 => Fast Z80, 2 => 8080, 3 => GB
parameter T2Write = 0; // 0 => wr_n active in T3, /=0 => wr_n active in T2
parameter IOWait = 1; // 0 => Single cycle I/O, 1 => Std I/O cycle
 
 
input reset_n;
input clk;
input wait_n;
input int_n;
input nmi_n;
input busrq_n;
output m1_n;
output mreq_n;
output iorq_n;
output rd_n;
output wr_n;
output rfsh_n;
output halt_n;
output busak_n;
output [15:0] A;
input [7:0] di;
output [7:0] dout;
 
reg mreq_n;
reg iorq_n;
reg rd_n;
reg wr_n;
reg nxt_mreq_n;
reg nxt_iorq_n;
reg nxt_rd_n;
reg nxt_wr_n;
wire cen;
wire intcycle_n;
wire no_read;
wire write;
wire iorq;
reg [7:0] di_reg;
wire [6:0] mcycle;
wire [6:0] tstate;
 
assign cen = 1;
 
tv80_core #(Mode, IOWait) i_tv80_core
(
.cen (cen),
.m1_n (m1_n),
.iorq (iorq),
.no_read (no_read),
.write (write),
.rfsh_n (rfsh_n),
.halt_n (halt_n),
.wait_n (wait_n),
.int_n (int_n),
.nmi_n (nmi_n),
.reset_n (reset_n),
.busrq_n (busrq_n),
.busak_n (busak_n),
.clk (clk),
.IntE (),
.stop (),
.A (A),
.dinst (di),
.di (di_reg),
.dout (dout),
.mc (mcycle),
.ts (tstate),
.intcycle_n (intcycle_n)
);
 
always @*
begin
nxt_mreq_n = 1;
nxt_rd_n = 1;
nxt_iorq_n = 1;
nxt_wr_n = 1;
if (mcycle[0])
begin
if (tstate[1] || tstate[2])
begin
nxt_rd_n = ~ intcycle_n;
nxt_mreq_n = ~ intcycle_n;
nxt_iorq_n = intcycle_n;
end
end // if (mcycle[0])
else
begin
if ((tstate[1] || tstate[2]) && !no_read && !write)
begin
nxt_rd_n = 1'b0;
nxt_iorq_n = ~ iorq;
nxt_mreq_n = iorq;
end
if (T2Write == 0)
begin
if (tstate[2] && write)
begin
nxt_wr_n = 1'b0;
nxt_iorq_n = ~ iorq;
nxt_mreq_n = iorq;
end
end
else
begin
if ((tstate[1] || (tstate[2] && !wait_n)) && write)
begin
nxt_wr_n = 1'b0;
nxt_iorq_n = ~ iorq;
nxt_mreq_n = iorq;
end
end // else: !if(T2write == 0)
end // else: !if(mcycle[0])
end // always @ *
 
always @(negedge clk)
begin
if (!reset_n)
begin
rd_n <= #1 1'b1;
wr_n <= #1 1'b1;
iorq_n <= #1 1'b1;
mreq_n <= #1 1'b1;
end
else
begin
rd_n <= #1 nxt_rd_n;
wr_n <= #1 nxt_wr_n;
iorq_n <= #1 nxt_iorq_n;
mreq_n <= #1 nxt_mreq_n;
end // else: !if(!reset_n)
end // always @ (posedge clk or negedge reset_n)
 
always @(posedge clk)
begin
if (!reset_n)
begin
di_reg <= #1 0;
end
else
begin
if (tstate[2] && wait_n == 1'b1)
di_reg <= #1 di;
end // else: !if(!reset_n)
end // always @ (posedge clk)
endmodule // t80n
 
/zx_ula/branches/xilinx/spectrum_48k_for_digilent_spartan3_starter_kit_with_ps2_keyboard/ula.v
0,0 → 1,334
`timescale 1ns / 1ps
//////////////////////////////////////////////////////////////////////////////////
// Company: Dept. Architecture and Computing Technology. University of Seville
// Engineer: Miguel Angel Rodriguez Jodar. rodriguj@atc.us.es
//
// Create Date: 19:13:39 4-Apr-2012
// Design Name: ZX Spectrum
// Module Name: ula
// Project Name:
// Target Devices:
// Tool versions:
// Description:
//
// Dependencies:
//
// Revision:
// Revision 1.00 - File Created
// Additional Comments: GPL License policies apply to the contents of this file.
//
//////////////////////////////////////////////////////////////////////////////////
 
`define cyclestart(a,b) ((a)==(b))
`define cycleend(a,b) ((a)==(b+1))
 
module ula(
input clk14, // 14MHz master clock
// CPU interfacing
input [15:0] a, // Address bus from CPU (not all lines are used)
input [7:0] din, // Input data bus from CPU
output [7:0] dout, // Output data bus to CPU
input mreq_n, // MREQ from CPU
input iorq_n, // IORQ from CPU
input rd_n, // RD from CPU
input wr_n, // WR from CPU
input rfsh_n, // RFSH from CPU
output clkcpu, // CLK to CPU
output msk_int_n, // Vertical retrace interrupt, to CPU
// VRAM interfacing
output [13:0] va, // Address bus to VRAM (16K)
input [7:0] vramdout,// Data from VRAM to ULA/CPU
output [7:0] vramdin,// Data from CPU to VRAM
output vramoe, //
output vramcs, // Control signals for VRAM
output vramwe, //
// ULA I/O
input ear, //
output mic, // I/O ports
output spk, //
output [7:0] kbrows, // Keyboard rows
input [4:0] kbcolumns, // Keyboard columns
// Video output
output r, //
output g, // RGB TTL signal
output b, // with separate bright
output i, // and composite sync
output csync //
);
 
reg [2:0] BorderColor = 3'b100;
 
// Pixel clock
reg clk7 = 0;
always @(posedge clk14)
clk7 <= !clk7;
// Horizontal counter
reg [8:0] hc = 0;
always @(posedge clk7) begin
if (hc==447)
hc <= 0;
else
hc <= hc + 1;
end
// Vertical counter
reg [8:0] vc = 0;
always @(posedge clk7) begin
if (hc==447) begin
if (vc == 311)
vc <= 0;
else
vc <= vc + 1;
end
end
// HBlank generation
reg HBlank_n = 1;
always @(negedge clk7) begin
if (`cyclestart(hc,320))
HBlank_n <= 0;
else if (`cycleend(hc,415))
HBlank_n <= 1;
end
 
// HSync generation (6C ULA version)
reg HSync_n = 1;
always @(negedge clk7) begin
if (`cyclestart(hc,344))
HSync_n <= 0;
else if (`cycleend(hc,375))
HSync_n <= 1;
end
 
// VBlank generation
reg VBlank_n = 1;
always @(negedge clk7) begin
if (`cyclestart(vc,248))
VBlank_n <= 0;
else if (`cycleend(vc,255))
VBlank_n <= 1;
end
// VSync generation (PAL)
reg VSync_n = 1;
always @(negedge clk7) begin
if (`cyclestart(vc,248))
VSync_n <= 0;
else if (`cycleend(vc,251))
VSync_n <= 1;
end
// INT generation
reg INT_n = 1;
assign msk_int_n = INT_n;
always @(negedge clk7) begin
if (`cyclestart(vc,248) && `cyclestart(hc,0))
INT_n <= 0;
else if (`cyclestart(vc,248) && `cycleend(hc,31))
INT_n <= 1;
end
 
// Border control signal (=0 when we're not displaying paper/ink pixels)
reg Border_n = 1;
always @(negedge clk7) begin
if ( (vc[7] & vc[6]) | vc[8] | hc[8])
Border_n <= 0;
else
Border_n <= 1;
end
// VidEN generation (delaying Border 8 clocks)
reg VidEN_n = 1;
always @(negedge clk7) begin
if (hc[3])
VidEN_n <= !Border_n;
end
// DataLatch generation (posedge to capture data from memory)
reg DataLatch_n = 1;
always @(negedge clk7) begin
if (hc[0] & !hc[1] & Border_n & hc[3])
DataLatch_n <= 0;
else
DataLatch_n <= 1;
end
// AttrLatch generation (posedge to capture data from memory)
reg AttrLatch_n = 1;
always @(negedge clk7) begin
if (hc[0] & hc[1] & Border_n & hc[3])
AttrLatch_n <= 0;
else
AttrLatch_n <= 1;
end
 
// SLoad generation (negedge to load shift register)
reg SLoad = 0;
always @(negedge clk7) begin
if (!hc[0] & !hc[1] & hc[2] & !VidEN_n)
SLoad <= 1;
else
SLoad <= 0;
end
// AOLatch generation (negedge to update attr output latch)
reg AOLatch_n = 1;
always @(negedge clk7) begin
if (hc[0] & !hc[1] & hc[2])
AOLatch_n <= 0;
else
AOLatch_n <= 1;
end
 
// First buffer for bitmap
reg [7:0] BitmapReg = 0;
always @(negedge DataLatch_n) begin
BitmapReg <= vramdout;
end
// Shift register (second bitmap register)
reg [7:0] SRegister = 0;
always @(negedge clk7) begin
if (SLoad)
SRegister <= BitmapReg;
else
SRegister <= {SRegister[6:0],1'b0};
end
 
// First buffer for attribute
reg [7:0] AttrReg = 0;
always @(negedge AttrLatch_n) begin
AttrReg <= vramdout;
end
// Second buffer for attribute
reg [7:0] AttrOut = 0;
always @(negedge AOLatch_n) begin
if (!VidEN_n)
AttrOut <= AttrReg;
else
AttrOut <= {2'b00,BorderColor,BorderColor};
end
 
// Flash counter and pixel generation
reg [4:0] FlashCnt = 0;
always @(negedge VSync_n) begin
FlashCnt <= FlashCnt + 1;
end
wire Pixel = SRegister[7] ^ (AttrOut[7] & FlashCnt[4]);
 
// RGB generation
reg rI,rG,rR,rB;
assign r = rR;
assign g = rG;
assign b = rB;
assign i = rI;
always @(*) begin
if (HBlank_n && VBlank_n)
{rI,rG,rR,rB} = (Pixel)? {AttrOut[6],AttrOut[2:0]} : {AttrOut[6],AttrOut[5:3]};
else
{rI,rG,rR,rB} = 4'b0000;
end
//CSync generation
assign csync = HSync_n & VSync_n;
// VRAM address and control line generation
reg [13:0] rVA = 0;
reg rVCS = 0;
reg rVOE = 0;
reg rVWE = 0;
assign va = rVA;
assign vramcs = rVCS;
assign vramoe = rVOE;
assign vramwe = rVWE;
// Latches to hold delayed versions of V and H counters
reg [8:0] v = 0;
reg [8:0] c = 0;
// Address and control line multiplexor ULA/CPU
always @(negedge clk7) begin
if (Border_n && (hc[3:0]==4'b0111 || hc[3:0]==4'b1011)) begin // cycles 7 and 11: load V and C from VC and HC
c <= hc;
v <= vc;
end
end
// Address and control line multiplexor ULA/CPU
always @(*) begin
if (Border_n && (hc[3:0]==4'b1000 || hc[3:0]==4'b1001 || hc[3:0]==4'b1100 || hc[3:0]==4'b1101)) begin // cycles 8 and 12: present display address to VRAM
rVA = {1'b0,v[7:6],v[2:0],v[5:3],c[7:3]}; // (cycles 9 and 13 load display byte)
rVCS = 1;
rVOE = !hc[0];
rVWE = 0;
end
else if (Border_n && (hc[3:0]==4'b1010 || hc[3:0]==4'b1011 || hc[3:0]==4'b1110 || hc[3:0]==4'b1111)) begin // cycles 10 and 14: present attribute address to VRAM
rVA = {4'b0110,v[7:3],c[7:3]}; // (cycles 11 and 15 load attr byte)
rVCS = 1;
rVOE = !hc[0];
rVWE = 0;
end
else if (Border_n && hc[3:0]==4'b0000) begin
rVA = a[13:0];
rVCS = 0;
rVOE = 0;
rVWE = 0;
end
else begin // when VRAM is not in use by ULA, give it to CPU
rVA = a[13:0];
rVCS = !a[15] & a[14] & !mreq_n;
rVOE = !rd_n;
rVWE = !wr_n;
end
end
// CPU contention
reg CPUClk = 0;
assign clkcpu = CPUClk;
reg ioreqtw3 = 0;
reg mreqt23 = 0;
wire ioreq_n = a[0] | iorq_n;
wire Nor1 = (~(a[14] | ~ioreq_n)) |
(~(~a[15] | ~ioreq_n)) |
(~(hc[2] | hc[3])) |
(~Border_n | ~ioreqtw3 | ~CPUClk | ~mreqt23);
wire Nor2 = (~(hc[2] | hc[3])) |
~Border_n |
~CPUClk |
ioreq_n |
~ioreqtw3;
wire CLKContention = ~Nor1 | ~Nor2;
always @(posedge clk7) begin // change clk7 by clk14 for 7MHz CPU clock operation
if (CPUClk && !CLKContention) // if there's no contention, the clock can go low
CPUClk <= 0;
else
CPUClk <= 1;
end
always @(posedge CPUClk) begin
ioreqtw3 <= ioreq_n;
mreqt23 <= mreq_n;
end
// ULA-CPU interface
assign dout = (!a[15] & a[14] & !mreq_n)? vramdout : // CPU reads VRAM through ULA as in the +3, not directly
(!iorq_n & !a[0])? {1'b1,ear,1'b1,kbcolumns} : // CPU reads keyboard and EAR state
(Border_n)? AttrReg : // to emulate
8'hFF; // port FF
assign vramdin = din; // The CPU doesn't need to share the memory input data bus with the ULA
assign kbrows = {a[11]? 1'bz : 1'b0, // high impedance or 0, as if diodes were been placed in between
a[10]? 1'bz : 1'b0, // if the keyboard matrix is to be implemented within the FPGA, then
a[9]? 1'bz : 1'b0, // there's no need to do this.
a[12]? 1'bz : 1'b0,
a[13]? 1'bz : 1'b0,
a[8]? 1'bz : 1'b0,
a[14]? 1'bz : 1'b0,
a[15]? 1'bz : 1'b0 };
reg rMic = 0;
reg rSpk = 0;
assign mic = rMic;
assign spk = rSpk;
always @(negedge clk7) begin
if (!iorq_n & !a[0] & !wr_n)
{rSpk,rMic,BorderColor} <= din[5:0];
end
endmodule
/zx_ula/branches/xilinx/spectrum_48k_for_digilent_spartan3_starter_kit_with_ps2_keyboard/zx_spectrum_48k.gise
0,0 → 1,30
<?xml version="1.0" encoding="UTF-8" standalone="no" ?>
<generated_project xmlns="http://www.xilinx.com/XMLSchema" xmlns:xil_pn="http://www.xilinx.com/XMLSchema">
 
<!-- -->
 
<!-- For tool use only. Do not edit. -->
 
<!-- -->
 
<!-- ProjectNavigator created generated project file. -->
 
<!-- For use in tracking generated file and other information -->
 
<!-- allowing preservation of process status. -->
 
<!-- -->
 
<!-- Copyright (c) 1995-2010 Xilinx, Inc. All rights reserved. -->
 
<version xmlns="http://www.xilinx.com/XMLSchema">11.1</version>
 
<sourceproject xmlns="http://www.xilinx.com/XMLSchema" xil_pn:fileType="FILE_XISE" xil_pn:name="zx_spectrum_48k.xise"/>
 
<files xmlns="http://www.xilinx.com/XMLSchema">
<file xil_pn:fileType="FILE_NCD" xil_pn:name="tld_spartan3_sp48k_guide.ncd" xil_pn:origination="imported"/>
</files>
 
<transforms xmlns="http://www.xilinx.com/XMLSchema"/>
 
</generated_project>
/zx_ula/branches/xilinx/spectrum_48k_for_digilent_spartan3_starter_kit_with_ps2_keyboard/spectrum48k_tld.v
0,0 → 1,268
`timescale 1ns / 1ps
//////////////////////////////////////////////////////////////////////////////////
// Company: Dept. Architecture and Computing Technology. University of Seville
// Engineer: Miguel Angel Rodriguez Jodar. rodriguj@atc.us.es
//
// Create Date: 19:13:39 4-Apr-2012
// Design Name: ZX Spectrum
// Module Name: tld_spartan3_sp48k
// Project Name:
// Target Devices:
// Tool versions:
// Description:
//
// Dependencies:
//
// Revision:
// Revision 1.00 - File Created
// Additional Comments: GPL License policies apply to the contents of this file.
//
//////////////////////////////////////////////////////////////////////////////////
module tld_spartan3_sp48k (
input clk50,
input reset,
output r,
output g,
output b,
output i,
output csync,
// ULA I/O
input ear,
output audio_out,
// PS/2 keyboard
input clkps2,
input dataps2,
// diagnostics
output [6:0] dispcathodes,
output [3:0] dispanodes,
output ledreleased,
output ledextended,
output ledshift,
output ledclk,
output [3:0] ledaux,
// SRAM memory
output [17:0] sa,
inout [7:0] sd1,
output sramce1,
output sramub1,
output sramlb1,
output sramoe,
output sramwe
);
 
// CPU signals
wire [15:0] a;
wire [7:0] cpudout;
wire [7:0] cpudin;
wire clkcpu;
wire mreq_n;
wire iorq_n;
wire wr_n;
wire rd_n;
wire rfsh_n;
wire int_n;
 
// VRAM signals
wire [13:0] va;
wire [7:0] vramdin;
wire [7:0] vramdout;
wire vramoe;
wire vramcs;
wire vramwe;
// I/O
wire mic;
wire spk;
wire [4:0] kbd_columns;
 
// ULA data bus
wire [7:0] uladout;
wire [7:0] uladin;
// SRAM data bus
wire [7:0] sramdout;
wire [7:0] sramdin;
// ROM data bus
wire [7:0] romdout;
 
wire sram_cs = a[15] & !mreq_n;
wire ula_cs = !a[0] & !iorq_n;
wire vram_cs = !a[15] & a[14] & !mreq_n;
wire port255_cs = !iorq_n && a[7:0]==8'hFF && !rd_n;
wire rom_cs = !a[15] & !a[14] & !mreq_n & !rd_n;
 
/////////////////////////////////////
// Master clock (14MHz) generation
/////////////////////////////////////
wire clk28mhz;
master_clock clock28mhz (
.CLKIN_IN(clk50),
.CLKFX_OUT(clk28mhz),
.CLKIN_IBUFG_OUT(),
.CLK0_OUT()
);
reg clk14 = 0;
always @(posedge clk28mhz) begin
clk14 = !clk14;
end
wire clkula = clk14;
wire clkmem = clk28mhz;
wire clkaudio = clk14;
wire clkkbd = clk14;
/////////////////////////////////////
// ROM
/////////////////////////////////////
rom the_rom (
.clka(clkmem),
.ena(rom_cs),
.addra(a[13:0]),
.douta(romdout)
);
 
/////////////////////////////////////
// VRAM and upper RAM banks
/////////////////////////////////////
ram_controller vram_and_upper_ram (
.clk(clkmem),
// Bank 1 (VRAM)
.a1({2'b00,va}),
.cs1_n(!vramcs),
.oe1_n(!vramoe),
.we1_n(!vramwe),
.din1(vramdin),
.dout1(vramdout),
// Bank 2 (upper RAM)
.a2({1'b0,a[14:0]}),
.cs2_n(!sram_cs),
.oe2_n(rd_n),
.we2_n(wr_n),
.din2(sramdin),
.dout2(sramdout),
// Outputs to actual SRAM on board
.sa(sa),
.sd(sd1),
.sramce(sramce1),
.sramub(sramub1),
.sramlb(sramlb1),
.sramoe(sramoe),
.sramwe(sramwe)
);
 
/////////////////////////////////////
// The ULA
/////////////////////////////////////
ula the_ula (
.clk14(clkula),
.a(a),
.din(uladin),
.dout(uladout),
.mreq_n(mreq_n),
.iorq_n(iorq_n),
.rd_n(rd_n),
.wr_n(wr_n),
.rfsh_n(rfsh_n),
.clkcpu(clkcpu),
.msk_int_n(int_n),
.va(va),
.vramdout(vramdout),
.vramdin(vramdin),
.vramoe(vramoe),
.vramcs(vramcs),
.vramwe(vramwe),
.ear(ear),
.mic(mic),
.spk(spk),
.kbrows(),
.kbcolumns(kbd_columns),
.r(r),
.g(g),
.b(b),
.i(i),
.csync(csync)
);
 
/////////////////////////////////////
// The CPU Z80A
/////////////////////////////////////
tv80n cpu (
// Outputs
.m1_n(),
.mreq_n(mreq_n),
.iorq_n(iorq_n),
.rd_n(rd_n),
.wr_n(wr_n),
.rfsh_n(rfsh_n),
.halt_n(),
.busak_n(),
.A(a),
.dout(cpudout),
// Inputs
.reset_n(!reset),
.clk(clkcpu),
.wait_n(1'b1),
.int_n(int_n),
.nmi_n(1'b1),
.busrq_n(1'b1),
.di(cpudin)
);
 
/////////////////////////////////////
// CPU data bus
/////////////////////////////////////
assign sramdin = cpudout;
assign uladin = cpudout;
assign cpudin = (rom_cs)? romdout :
(ula_cs | vram_cs | port255_cs)? uladout :
(sram_cs)? sramdout :
8'hFF;
 
/////////////////////////////////////
// Audio mixer
/////////////////////////////////////
mixer audio_mix (
.clkdac(clkaudio),
.reset(reset),
.ear(ear),
.mic(mic),
.spk(spk),
.audio(audio_out)
);
 
/////////////////////////////////////
// PS2 Keyboard
/////////////////////////////////////
wire [7:0] kbdscancode;
ps2kbd keyboard (
.clk(clkkbd),
.reset(reset),
.clkps2(clkps2),
.dataps2(dataps2),
.ledextended(ledextended),
.ledreleased(ledreleased),
.ledmayus(ledshift),
.scancode(kbdscancode),
.semifila(a[15:8]),
.columna(kbd_columns)
);
 
/////////////////////////////////////
// Diagnostics
/////////////////////////////////////
display numeric_display (
.clk(clkkbd),
.load(int_n),
.valor({8'h00,kbdscancode}),
.an(dispanodes),
.seg(dispcathodes)
);
 
reg [19:0] divclkcpu = 0;
assign ledclk = divclkcpu[19]; // a simple "hearbeat" blink to let us know that the CPU is running.
always @(posedge clkcpu)
divclkcpu <= divclkcpu + 1;
assign ledaux = 4'b0000;
endmodule
/zx_ula/branches/xilinx/spectrum_48k_for_digilent_spartan3_starter_kit_with_ps2_keyboard/rom.v
0,0 → 1,158
/*******************************************************************************
* (c) Copyright 1995 - 2010 Xilinx, Inc. All rights reserved. *
* *
* This file contains confidential and proprietary information *
* of Xilinx, Inc. and is protected under U.S. and *
* international copyright and other intellectual property *
* laws. *
* *
* DISCLAIMER *
* This disclaimer is not a license and does not grant any *
* rights to the materials distributed herewith. Except as *
* otherwise provided in a valid license issued to you by *
* Xilinx, and to the maximum extent permitted by applicable *
* law: (1) THESE MATERIALS ARE MADE AVAILABLE "AS IS" AND *
* WITH ALL FAULTS, AND XILINX HEREBY DISCLAIMS ALL WARRANTIES *
* AND CONDITIONS, EXPRESS, IMPLIED, OR STATUTORY, INCLUDING *
* BUT NOT LIMITED TO WARRANTIES OF MERCHANTABILITY, NON- *
* INFRINGEMENT, OR FITNESS FOR ANY PARTICULAR PURPOSE; and *
* (2) Xilinx shall not be liable (whether in contract or tort, *
* including negligence, or under any other theory of *
* liability) for any loss or damage of any kind or nature *
* related to, arising under or in connection with these *
* materials, including for any direct, or any indirect, *
* special, incidental, or consequential loss or damage *
* (including loss of data, profits, goodwill, or any type of *
* loss or damage suffered as a result of any action brought *
* by a third party) even if such damage or loss was *
* reasonably foreseeable or Xilinx had been advised of the *
* possibility of the same. *
* *
* CRITICAL APPLICATIONS *
* Xilinx products are not designed or intended to be fail- *
* safe, or for use in any application requiring fail-safe *
* performance, such as life-support or safety devices or *
* systems, Class III medical devices, nuclear facilities, *
* applications related to the deployment of airbags, or any *
* other applications that could lead to death, personal *
* injury, or severe property or environmental damage *
* (individually and collectively, "Critical *
* Applications"). Customer assumes the sole risk and *
* liability of any use of Xilinx products in Critical *
* Applications, subject only to applicable laws and *
* regulations governing limitations on product liability. *
* *
* THIS COPYRIGHT NOTICE AND DISCLAIMER MUST BE RETAINED AS *
* PART OF THIS FILE AT ALL TIMES. *
*******************************************************************************/
// The synthesis directives "translate_off/translate_on" specified below are
// supported by Xilinx, Mentor Graphics and Synplicity synthesis
// tools. Ensure they are correct for your synthesis tool(s).
 
// You must compile the wrapper file rom.v when simulating
// the core, rom. When compiling the wrapper file, be sure to
// reference the XilinxCoreLib Verilog simulation library. For detailed
// instructions, please refer to the "CORE Generator Help".
 
`timescale 1ns/1ps
 
module rom(
clka,
ena,
addra,
douta);
 
 
input clka;
input ena;
input [13 : 0] addra;
output [7 : 0] douta;
 
// synthesis translate_off
 
BLK_MEM_GEN_V4_3 #(
.C_ADDRA_WIDTH(14),
.C_ADDRB_WIDTH(14),
.C_ALGORITHM(1),
.C_BYTE_SIZE(9),
.C_COMMON_CLK(0),
.C_DEFAULT_DATA("0"),
.C_DISABLE_WARN_BHV_COLL(0),
.C_DISABLE_WARN_BHV_RANGE(0),
.C_FAMILY("spartan3"),
.C_HAS_ENA(1),
.C_HAS_ENB(0),
.C_HAS_INJECTERR(0),
.C_HAS_MEM_OUTPUT_REGS_A(0),
.C_HAS_MEM_OUTPUT_REGS_B(0),
.C_HAS_MUX_OUTPUT_REGS_A(0),
.C_HAS_MUX_OUTPUT_REGS_B(0),
.C_HAS_REGCEA(0),
.C_HAS_REGCEB(0),
.C_HAS_RSTA(0),
.C_HAS_RSTB(0),
.C_HAS_SOFTECC_INPUT_REGS_A(0),
.C_HAS_SOFTECC_OUTPUT_REGS_B(0),
.C_INITA_VAL("0"),
.C_INITB_VAL("0"),
.C_INIT_FILE_NAME("rom.mif"),
.C_LOAD_INIT_FILE(1),
.C_MEM_TYPE(3),
.C_MUX_PIPELINE_STAGES(0),
.C_PRIM_TYPE(1),
.C_READ_DEPTH_A(16384),
.C_READ_DEPTH_B(16384),
.C_READ_WIDTH_A(8),
.C_READ_WIDTH_B(8),
.C_RSTRAM_A(0),
.C_RSTRAM_B(0),
.C_RST_PRIORITY_A("CE"),
.C_RST_PRIORITY_B("CE"),
.C_RST_TYPE("SYNC"),
.C_SIM_COLLISION_CHECK("ALL"),
.C_USE_BYTE_WEA(0),
.C_USE_BYTE_WEB(0),
.C_USE_DEFAULT_DATA(0),
.C_USE_ECC(0),
.C_USE_SOFTECC(0),
.C_WEA_WIDTH(1),
.C_WEB_WIDTH(1),
.C_WRITE_DEPTH_A(16384),
.C_WRITE_DEPTH_B(16384),
.C_WRITE_MODE_A("WRITE_FIRST"),
.C_WRITE_MODE_B("WRITE_FIRST"),
.C_WRITE_WIDTH_A(8),
.C_WRITE_WIDTH_B(8),
.C_XDEVICEFAMILY("spartan3"))
inst (
.CLKA(clka),
.ENA(ena),
.ADDRA(addra),
.DOUTA(douta),
.RSTA(),
.REGCEA(),
.WEA(),
.DINA(),
.CLKB(),
.RSTB(),
.ENB(),
.REGCEB(),
.WEB(),
.ADDRB(),
.DINB(),
.DOUTB(),
.INJECTSBITERR(),
.INJECTDBITERR(),
.SBITERR(),
.DBITERR(),
.RDADDRECC());
 
 
// synthesis translate_on
 
// XST black box declaration
// box_type "black_box"
// synthesis attribute box_type of rom is "black_box"
 
endmodule
 
/zx_ula/branches/xilinx/spectrum_48k_for_digilent_spartan3_starter_kit_with_ps2_keyboard/audio_management.v
0,0 → 1,81
`timescale 1ns / 1ps
//////////////////////////////////////////////////////////////////////////////////
// Company:
// Engineer:
//
// Create Date: 04:04:00 04/01/2012
// Design Name:
// Module Name: sigma_delta_dac
// Project Name:
// Target Devices:
// Tool versions:
// Description:
//
// Dependencies:
//
// Revision:
// Revision 0.01 - File Created
// Additional Comments:
//
//////////////////////////////////////////////////////////////////////////////////
 
`define MSBI 7 // Most significant Bit of DAC input
 
//This is a Delta-Sigma Digital to Analog Converter
module dac (DACout, DACin, Clk, Reset);
output DACout; // This is the average output that feeds low pass filter
input [`MSBI:0] DACin; // DAC input (excess 2**MSBI)
input Clk;
input Reset;
 
reg DACout; // for optimum performance, ensure that this ff is in IOB
reg [`MSBI+2:0] DeltaAdder; // Output of Delta adder
reg [`MSBI+2:0] SigmaAdder; // Output of Sigma adder
reg [`MSBI+2:0] SigmaLatch; // Latches output of Sigma adder
reg [`MSBI+2:0] DeltaB; // B input of Delta adder
 
always @(SigmaLatch) DeltaB = {SigmaLatch[`MSBI+2], SigmaLatch[`MSBI+2]} << (`MSBI+1);
always @(DACin or DeltaB) DeltaAdder = DACin + DeltaB;
always @(DeltaAdder or SigmaLatch) SigmaAdder = DeltaAdder + SigmaLatch;
always @(posedge Clk or posedge Reset)
begin
if(Reset)
begin
SigmaLatch <= #1 1'b1 << (`MSBI+1);
DACout <= #1 1'b0;
end
else
begin
SigmaLatch <= #1 SigmaAdder;
DACout <= #1 SigmaLatch[`MSBI+2];
end
end
endmodule
 
module mixer (
input clkdac,
input reset,
input ear,
input mic,
input spk,
output audio
);
reg [7:0] mix = 0;
always @(posedge clkdac)
mix <= ({ear,spk,mic}==3'b000)? 17 :
({ear,spk,mic}==3'b001)? 36 :
({ear,spk,mic}==3'b010)? 184 :
({ear,spk,mic}==3'b011)? 192 :
({ear,spk,mic}==3'b100)? 22 :
({ear,spk,mic}==3'b101)? 48 :
({ear,spk,mic}==3'b110)? 244 : 255;
 
dac audio_dac (
.DACout(audio),
.DACin(mix),
.Clk(clkdac),
.Reset(reset)
);
endmodule
/zx_ula/branches/xilinx/spectrum_48k_for_digilent_spartan3_starter_kit_with_ps2_keyboard/tv80_reg.v
0,0 → 1,77
//
// TV80 8-Bit Microprocessor Core
// Based on the VHDL T80 core by Daniel Wallner (jesus@opencores.org)
//
// Copyright (c) 2004 Guy Hutchison (ghutchis@opencores.org)
//
// Permission is hereby granted, free of charge, to any person obtaining a
// copy of this software and associated documentation files (the "Software"),
// to deal in the Software without restriction, including without limitation
// the rights to use, copy, modify, merge, publish, distribute, sublicense,
// and/or sell copies of the Software, and to permit persons to whom the
// Software is furnished to do so, subject to the following conditions:
//
// The above copyright notice and this permission notice shall be included
// in all copies or substantial portions of the Software.
//
// THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND,
// EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF
// MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT.
// IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY
// CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT,
// TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE
// SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
 
module tv80_reg (/*AUTOARG*/
// Outputs
DOBH, DOAL, DOCL, DOBL, DOCH, DOAH,
// Inputs
AddrC, AddrA, AddrB, DIH, DIL, clk, CEN, WEH, WEL
);
input [2:0] AddrC;
output [7:0] DOBH;
input [2:0] AddrA;
input [2:0] AddrB;
input [7:0] DIH;
output [7:0] DOAL;
output [7:0] DOCL;
input [7:0] DIL;
output [7:0] DOBL;
output [7:0] DOCH;
output [7:0] DOAH;
input clk, CEN, WEH, WEL;
 
reg [7:0] RegsH [0:7];
reg [7:0] RegsL [0:7];
 
always @(posedge clk)
begin
if (CEN)
begin
if (WEH) RegsH[AddrA] <= DIH;
if (WEL) RegsL[AddrA] <= DIL;
end
end
assign DOAH = RegsH[AddrA];
assign DOAL = RegsL[AddrA];
assign DOBH = RegsH[AddrB];
assign DOBL = RegsL[AddrB];
assign DOCH = RegsH[AddrC];
assign DOCL = RegsL[AddrC];
 
// break out ram bits for waveform debug
// synopsys translate_off
wire [7:0] B = RegsH[0];
wire [7:0] C = RegsL[0];
wire [7:0] D = RegsH[1];
wire [7:0] E = RegsL[1];
wire [7:0] H = RegsH[2];
wire [7:0] L = RegsL[2];
 
wire [15:0] IX = { RegsH[3], RegsL[3] };
wire [15:0] IY = { RegsH[7], RegsL[7] };
// synopsys translate_on
endmodule
 
/zx_ula/branches/xilinx/spectrum_48k_for_digilent_spartan3_starter_kit_with_ps2_keyboard/teclado_ps2.v
0,0 → 1,334
`timescale 1ns / 1ps
//////////////////////////////////////////////////////////////////////////////////
// Company: Dept. Architecture and Computing Technology. University of Seville
// Engineer: Miguel Angel Rodriguez Jodar. rodriguj@atc.us.es
//
// Create Date: 19:13:39 4-Apr-2012
// Design Name: ZX Spectrum
// Module Name: PS2 keyboard interface for ZX Spectrum.
// Project Name:
// Target Devices:
// Tool versions:
// Description:
//
// Dependencies:
//
// Revision:
// Revision 1.00 - File Created
// Additional Comments: GPL License policies apply to the contents of this file.
//
//////////////////////////////////////////////////////////////////////////////////
module ps2kbd (
input clk,
input reset,
input clkps2,
input dataps2,
output ledextended,
output ledreleased,
output ledmayus,
output [7:0] scancode,
input [7:0] semifila,
output [4:0] columna
);
 
reg rload = 0;
reg [1:0] estado = 0;
 
wire [7:0] tecla;
wire recibida;
reg [7:0] rscancode=8'h00;
assign scancode = rscancode;
 
reg extended = 0;
reg released = 0;
reg mayus = 0;
assign ledextended = extended;
assign ledreleased = released;
assign ledmayus = mayus;
 
ps2_keyboard ps2_get_scancode (
.clk(clk),
.reset(reset),
.ps2_clk(clkps2),
.ps2_data(dataps2),
.interrupt(recibida),
.rx_scan_code(tecla)
);
 
matrix scancode_to_zx_keyboard (
.clk(clk),
.keyreceived(rload),
.scancode(tecla),
.mayus(mayus),
.extended(extended),
.released(released),
.semifila(semifila),
.columna(columna)
);
 
always @(posedge clk)
begin
case (estado)
0: if (recibida) // if a new key has just been received at the PS2 port...
begin
if (tecla==8'h12 || tecla==8'h59) begin // if it's one of the two shift keys,
mayus <= 1; // signal it.
end
else if (tecla==8'hE0) begin // if this is the beginning of an extended key
extended <= 1; // signal it...
released <= 0; // (this is not a released key)
estado <= 1; // ...and wait for the next code
end
else if (tecla==8'hF0) begin // if this is the beginning of a released key
extended <= 0; // then it's not an extended key
released <= 1; // signal it...
estado <= 2; // ... and wait for the next code
end
else if (tecla!=8'hE0 && tecla!=8'hF0 && tecla!=8'h12 && tecla!=8'h59) begin // if this is a "normal" key
rscancode <= tecla; // store its scancode
extended <= 0; //
released <= 0; // signal it as "normal": not released, not extended
rload <= 1; //no estaba // a new key has arrived. Signal that to the matrix module
estado <= 0; //3; // and go for another key (the next clock will have "recibida" = 0, so
end // it will go to the "else" part of this "if" statement, to deassert "rload")
end
else
rload <= 0; // if a new key has not been received, just turn off the "new key arrived" signal
1: if (recibida) // if a new extended key has just been received at the PS2 port...
begin
if (tecla==8'hF0) begin // if this is the beginning of a released extended key...
released <= 1; // ... signal it, and
estado <= 2; // ... wait for the actual scancode of the released key
end
else if (tecla!=8'hE0 && tecla!=8'hF0 && tecla!=8'h12 && tecla!=8'h59) begin // if this is the actual scancode of a new pressed extended key...
rscancode <= tecla; // store it...
rload <= 1; //no estaba // assert "rload"...
estado <= 0; //3; // and go for another key...
end
end
else
rload <= 0;
2: if (recibida) // if a new released key has just been received at the PS2 port...
begin
if (tecla==8'h12 || tecla==8'h59) begin // if it is one of the shift keys
mayus <= 0; // deassert "mayus" to signal that shift is no longer pressed
estado <= 0;
end
else if (tecla!=8'hE0 && tecla!=8'hF0 && tecla!=8'h12 && tecla!=8'h59) begin // if this is any other key...
rscancode <= tecla; // store it...
rload <= 1; // assert "rload"
estado <= 0; // and go for another key
end
end
else
rload <= 0;
endcase
end
endmodule
 
module matrix (
input clk,
input keyreceived,
input [7:0] scancode,
input mayus,
input extended,
input released,
input [7:0] semifila,
output [4:0] columna
);
reg [4:0] thematrix[0:7]; // memory representing 40 keys
initial begin // initially, all keys are released (0=pressed)
thematrix[0] = 5'b11111;
thematrix[1] = 5'b11111;
thematrix[2] = 5'b11111;
thematrix[3] = 5'b11111;
thematrix[4] = 5'b11111;
thematrix[5] = 5'b11111;
thematrix[6] = 5'b11111;
thematrix[7] = 5'b11111;
end
// output bits to ULA are composed with data from the eight half-rows, depending upon which
// bits were resetted at CPU address bus bits 8-15 (row selection)
assign columna = ((!semifila[0])? thematrix[0] : 5'b11111) &
((!semifila[1])? thematrix[1] : 5'b11111) &
((!semifila[2])? thematrix[2] : 5'b11111) &
((!semifila[3])? thematrix[3] : 5'b11111) &
((!semifila[4])? thematrix[4] : 5'b11111) &
((!semifila[5])? thematrix[5] : 5'b11111) &
((!semifila[6])? thematrix[6] : 5'b11111) &
((!semifila[7])? thematrix[7] : 5'b11111);
// ROM's containing the ZX Spectrum equivalent key(s) for each PS2 key. For Spectrum shifted keys
// (such as = * + ! CURSOR-LEFT, DELETE, EDIT, etc), a memory location contains two values: one of
// them is either CAPS SHIFT or SYMBOL SHIFT. The other one is the key that would have to be pressed along
// with the shift key on the ZX Spectrum keyboard.
// These ROM's are filled in the file "mapa_es.inc". This file contains the mapping for a spanish keyboard.
// There is a ROM for normal PS2 keys, another one for PS2 shifted keys, another one for extended, non shifted
// keys, and the last one is for extended shifted keys.
// Cada posicion tiene: CODSEMIFILA1(3) , VALORSEMIFILA1(5) , CODSEMIFILA1(3) , VALORSEMIFILA1(5)
// These ROM's will be infered as BLOCK RAM because the address will be registered
reg [15:0] mapa_noshift_noext[0:131];
reg [15:0] mapa_shift_noext[0:131];
reg [15:0] mapa_noshift_ext[0:131];
reg [15:0] mapa_shift_ext[0:131];
 
`include "mapa_es.inc"
reg [2:0] row_key1_nosh_noex;
reg [2:0] row_key2_nosh_noex;
reg [2:0] row_key1_sh_noex;
reg [2:0] row_key2_sh_noex;
reg [2:0] row_key1_nosh_ex;
reg [2:0] row_key2_nosh_ex;
reg [2:0] row_key1_sh_ex;
reg [2:0] row_key2_sh_ex;
reg [4:0] col_key1_nosh_noex;
reg [4:0] col_key2_nosh_noex;
reg [4:0] col_key1_sh_noex;
reg [4:0] col_key2_sh_noex;
reg [4:0] col_key1_nosh_ex;
reg [4:0] col_key2_nosh_ex;
reg [4:0] col_key1_sh_ex;
reg [4:0] col_key2_sh_ex;
reg [7:0] addrmap; // to make the addr registered, so XST will infer block RAM.
reg [4:0] matrixstate = 0;
always @(posedge clk) begin
case (matrixstate)
0 : begin
if (keyreceived) begin // wait until a key is received.
matrixstate <= 1;
addrmap <= scancode;
end
end
1 : begin // paralell read the same in the four possible combinations
{row_key1_nosh_noex,
col_key1_nosh_noex,
row_key2_nosh_noex,
col_key2_nosh_noex} <= mapa_noshift_noext[addrmap];
{row_key1_sh_noex,
col_key1_sh_noex,
row_key2_sh_noex,
col_key2_sh_noex} <= mapa_shift_noext[addrmap];
{row_key1_nosh_ex,
col_key1_nosh_ex,
row_key2_nosh_ex,
col_key2_nosh_ex} <= mapa_noshift_ext[addrmap];
{row_key1_sh_ex,
col_key1_sh_ex,
row_key2_sh_ex,
col_key2_sh_ex} <= mapa_shift_ext[addrmap];
matrixstate <= 3;
end
3 : begin // apply matrix updates according to the actual combination pressed or released
case ( {mayus,extended,released} )
3'b000 : matrixstate <= 4; //non shifted, non extended, key pressed
3'b001 : matrixstate <= 6; //non shifted, non extended, key released
3'b010 : matrixstate <= 10; //non shifted, extended...
3'b011 : matrixstate <= 12; //
3'b100 : matrixstate <= 16; //shifted, non extended...
3'b101 : matrixstate <= 18; //
3'b110 : matrixstate <= 20; //shifted, extended...
3'b111 : matrixstate <= 22; //
default : matrixstate <= 0;
endcase
end
4 : begin // non shifted, non extended, key pressed, update key1 status
thematrix[row_key1_nosh_noex] <= thematrix[row_key1_nosh_noex] & col_key1_nosh_noex;
matrixstate <= 5;
end
5 : begin // update key2 status
thematrix[row_key2_nosh_noex] <= thematrix[row_key2_nosh_noex] & col_key2_nosh_noex;
matrixstate <= 0; // go for another key
end
 
6 : begin // non shifted, non extended, key released...
thematrix[row_key1_nosh_noex] <= thematrix[row_key1_nosh_noex] | ~col_key1_nosh_noex;
matrixstate <= 7;
end
7 : begin
thematrix[row_key2_nosh_noex] <= thematrix[row_key2_nosh_noex] | ~col_key2_nosh_noex;
matrixstate <= 8;
end
8 : begin // when a non shifted key releases, it released shifted version too...
thematrix[row_key1_sh_noex] <= thematrix[row_key1_sh_noex] | ~col_key1_sh_noex;
matrixstate <= 9;
end
9 : begin
thematrix[row_key2_sh_noex] <= thematrix[row_key2_sh_noex] | ~col_key2_sh_noex;
matrixstate <= 0;
end
 
10: begin // non shifted, extended, key pressed...
thematrix[row_key1_nosh_ex] <= thematrix[row_key1_nosh_ex] & col_key1_nosh_ex;
matrixstate <= 11;
end
11: begin
thematrix[row_key2_nosh_ex] <= thematrix[row_key2_nosh_ex] & col_key2_nosh_ex;
matrixstate <= 0; // go for another key
end
12: begin // non shifted, extended, key released...
thematrix[row_key1_nosh_ex] <= thematrix[row_key1_nosh_ex] | ~col_key1_nosh_ex;
matrixstate <= 13;
end
13: begin
thematrix[row_key2_nosh_ex] <= thematrix[row_key2_nosh_ex] | ~col_key2_nosh_ex;
matrixstate <= 14;
end
14: begin // when a non shifted key releases, it released shifted version too...
thematrix[row_key1_sh_ex] <= thematrix[row_key1_sh_ex] | ~col_key1_sh_ex;
matrixstate <= 15;
end
15: begin
thematrix[row_key2_sh_ex] <= thematrix[row_key2_sh_ex] | ~col_key2_sh_ex;
matrixstate <= 0;
end
16: begin // shifted, non extended, key pressed, update key1 status
thematrix[row_key1_sh_noex] <= thematrix[row_key1_sh_noex] & col_key1_sh_noex;
matrixstate <= 17;
end
17: begin // update key2 status
thematrix[row_key2_sh_noex] <= thematrix[row_key2_sh_noex] & col_key2_sh_noex;
matrixstate <= 0; // go for another key
end
 
18: begin // shifted, non extended, key released...
thematrix[row_key1_sh_noex] <= thematrix[row_key1_sh_noex] | ~col_key1_sh_noex;
matrixstate <= 19;
end
19: begin
thematrix[row_key2_sh_noex] <= thematrix[row_key2_sh_noex] | ~col_key2_sh_noex;
matrixstate <= 0;
end
20: begin // shifted, extended, key pressed, update key1 status
thematrix[row_key1_sh_ex] <= thematrix[row_key1_sh_ex] & col_key1_sh_ex;
matrixstate <= 21;
end
21: begin // update key2 status
thematrix[row_key2_sh_ex] <= thematrix[row_key2_sh_ex] & col_key2_sh_ex;
matrixstate <= 0; // go for another key
end
 
22: begin // shifted, extended, key released...
thematrix[row_key1_sh_ex] <= thematrix[row_key1_sh_ex] | ~col_key1_sh_ex;
matrixstate <= 23;
end
23: begin
thematrix[row_key2_sh_ex] <= thematrix[row_key2_sh_ex] | ~col_key2_sh_ex;
matrixstate <= 0;
end
endcase
end
endmodule
 
/zx_ula/branches/xilinx/spectrum_48k_for_digilent_spartan3_starter_kit_with_ps2_keyboard/rom.ngc
0,0 → 1,3
XILINX-XDB 0.1 STUB 0.1 ASCII
XILINX-XDM V1.6e
$21740<,[o}e~g`n;"2*726&;$?,)?40528456789:;<=>?0123456789:;<=>?0123456789:;<=>?0123456789:;<=>?012305=789:;<=>?01234567892?<=>?0123456789:;<=>?012345648?:;<=>>01233@6382:;<=>?03:;=325=1;>:>>=516E1C018J:>8IKKC@03GF479H:9<;?90722A611K0>;7=>?0123<=67IJ;:H8;9276114CDNH<3O=;9FCA@F527K?;?M=<;0123756C:O<MJ9>401235567<9:9<=??0103456?89:JIH9?812;<=6D0?;:>?;=357A73E78=23?>L<41934577:;OH==>>5D0572>0N>O>4<KI82D327478J<9:HM;E0;364>38M3H=<<;01A74>678=>;:OJ90@217DD7>:N?I8796DC75DG>1>L>M97MFB@3201F1>99H?6JB9023@2739:8<=O7D00;BD478::JONLNF@003G17:=?;8I=9A5@B636?989<J=;6E6::=472<=:0<=6?010361?78=:3==>79362616?80;?<=>?01214G@ANOOH:>6L30033G0D;;;?8=5?0931B16?KJ<><<=<1971167E8=>3<=<>D8014A2>8:K?=9>;300377>388?8JH7;0:23E=3B;J?JMH<L48FGG7@1K>H;=>JNCC12=D1111;3M<>71@50<<@098N<:L>6BB63?56DK?:<54?=4@:665E709?;=?<>700;5=6?8<2;=5M<8@471A601:;35;L<9DF1116<89N2459<7C@A01E39=8:<<?7C750F5E6JML<:N:69305B2>AN=;J<LH8AGF075>F<91;<KJI3C;A<AC2J><N5:H7D20E4C5>M=IJO;6K9C@A2=CF;0;>J;<=5G;06FGFNMK?<6>>01272361=>8>4>>?21:5446?89:>8N>I2EG;727FK9:;<L7?02G361>38J=H<5:?;13;1<31=1:;:46:14G24D>600ON5O==3D16G@1401N<?N8J7@73@5BB>>92O:=NC52844BBK8K>8;79B8;26@>E8>:>O5;77E6E3A51K1<8449MD2336DG1>:H3=4L:5C5B05=7:9:;4=>=0123<56589:;4=>?8127456389:9<=:?0127456589:;>=>?2123<57382:9<=<701:34535<H:98L:N29611723>;>;<=??0133552589:;99<95B5F436789>;7=<=0123456789:;<=6?05234165;HN?5;767C@EB=10J12=IHH>6GAE67?AI93:N9>4030;<D>7<?;9M?O?A021E17?KKNMNL;:45;:1171>9L3=?:941324466:?9:8?664193612508:=896:25C561G3I;>?>8<;2401436681::<8:<C12301G68<>98=>:E1274>65?8=;O8JMCB0A2DB0:K2N8NML95FBE45>L1HJ:9K<39607225>L=M>::LC9:B7227398H=?L>225;700CM;I>>=:>C@5B776D=8O;H:MN9G7G1230?<N>;KJ85EFE@C12N=:0<?K74G;55@5D09:JO;??D3555=47:989;5>6013B15BCLKK8859MB7CF<54EI9<>8=5?3103GFC7>===5O?:032B255701:9?9M94D;AAC>B11K3=966091B4706<9N=857;0:20EA67:<L;H8>6F71147B??>OHH5LI8126007A?KN8;>88CG2A@<D011?;M:J70@63?55D988?9HK<1D1;A3BBN;;34OK=07:E7F16>L;;?<9882214A>BN<I99;984CC3A16<8=:;<=>?01234F538;9H>H=?2547455D89:;<=>?01234567898;8;>?25234567<91;8=>=81234564K:>;:>><232001E38:I;8=>>0122446789:;<8>92661056789:?<6>;0923654388:?<56=41:3454781:2=96=EE7550C389;9IH8<0B1A6FBE:J;8M::?;161640B8;;=O5;M8831606E?8?<H87:5@F@43EE>1?INK>81C64@07>;:<8O<MJC5284145=9:35<>7896;<=26808?<9?=0567076>998;49<;1027652681298<?;447105=7<K?<H5K?D676<075;;284K7M526;<6>2;9N<MK7:403610B5>:H3OL69A4F1=A1382:?JK69DEDF=CEEL:NH>L:666D7=7ECL<K3JKLK99747551K<28J4J9D7C556>D8:>;7=8;4B;622E7JO32=<L771@:<<E21:9;<57NA5A;433FJ8H:=<==201FA5@C0::3=9>407CAG04C=MHNJ89JEC1054G>L1?O>8=M45G115C6=?<III;8C7FEAG4FJON:MIH941932F1?88;M;5J7B90F1<@7KM>I??J981352<DB;LH;N48661FEB43589?NO:M>6B@74>61M<KO:N6729:1=<6F<9N95>HJD147346DJ;8=OIO?322G3G7?1K9?89:=EB16A62739<M:;?=D6534=6>09K?<I<63GG@43?A9?II><8;C@207F341O<2N>9840CFB4EB;=:0<:99C70@740AN0>I<OM<A10;<AC1I?8I=9J9C0C1@DBA1KNM48L=CB@36FC6LK8O8=5?7C5;@6>788LN::K:6BAF7<?CM:<O;IJMD7;:@0EAK<H=H:O>433@A50AM=:ON;K;0:24@<66?1=;<9>?1B66=641:8:HOH>?C7CE351E0=>?<N=>3C33F=E3L89I>N8J0763?5>5K13:O:8N49664<048=K;H5;?21:3G47>008:546720F25F4>KH28<N=<75;:616<8133<=<?69210<>?:?3:M;M?49:1=7568K>8=>MJ86DEGA34:0K=8O9?8BC@<054<91;5>?=D@AF2761=?OJJ?:K56A3<C@E9=N9448>3EA065>4099I49JL6536BA3BLJ:?<6>63D322255=?H8=;7L130;0<>7M08J<>:>40G33=428>2;<K6>0123=F27;J:<4;:?;1C35CBD?OO9OOH?39C55ACF=OIN>N??C9D01CDA09I;9LLIF5@5=6350>H:>8K7D5284D77:1>?<=>?536B4D2F<H8;8L;=41654=6799:;==;;01614547>=??;H>9012305=7IM:;9H6<2807A<43:0I;5<J>66:32F778=;JJ><KDD30E30>10:?9:J?99A@6CC382:IN=:<4523<145;;=I=>7<C510=3G>;8H3O5M77304E3739J:N>IML77F;75G70;>;7=M7412;7DB30<;>?LMK3B2010?6>:::54L7C1;5G@2CK<?<H;J:5GA@@25?=>9O:9>40E3@7@350=>?H4L?0D755F271>9JI<6?6112G1030:>M<>J<4@32665F;=H88L?K4193A2>2:;HJ>5?=C0660D37:LN:M87LBE55E553?<<M9:8:DG5610@2?<=>J:H:7GD74>6AN1;MJK9IFCDE@C@AJOLMI<HI01:5B6739HKI:=>:802B40G6=0?J44=I9E:6==5<9':?<6??0D2B3776;=8OJ=<659272=?>MLHN:H:613;:E5?49;=<4<7<FG1G3C@FJH2;<=:?;022GF67:=K=O><?04A@F67>812?>??>616G<G55>8::=<6M55@2<=EE<M?;>K;I0528554E<9:N4=>;C52B@3C3>8>?:;=?8@@@3402IH?<<;>N3@502D7?0HHI?=>=01C205=68=93=>:J30A1<567<9:I=5:=2BC54CE3:J3H<>H?67152@EEJK::<O>?B127<51382;:=5<>333AE141I=LN84;9B516=4B6IJ8<=H6<E143717FM<L9<?=I092;52140:>;7<?>F913B<>2982?==?<717;<D61L:HM5LK920G4BFC1;;K=;47L8GGEEDCAM><2H9>4130;@<7D;<82=8:=4123456FI9:34K8<141B<DB?9K3?9N6888D35F>1==2O=?MJ41926A32:H2J<979EGG0EDE1N:><?4O64D5:<4660;9:85J710026@?F;=3HN??605;74>748L::;9J;FC67F7E7L>K2<:9?2@57<A6EI<:M4KO:425BGA5E;=9H?8><9G67@427389:<O>?A5;:47E799>;<9M955G31=47<9:;=<><64635466:98:5<<=80022G678=:0=9:N4445B11E?:I29OK9CE@:A303L<9=;;<J9307@26A1H?H?::M4E3@EG>CN<8<=95>4;KMTPR=IMNYM1?<:1<20>732@D[YY4NDEPA845=87;?7<:5IORVP?gcl{k7=>4?>06851<NFY__6ljkrc>27?69901:87AZTQWW>wbflmxnon2>3;2=05=6<L?OONOIE42@G45>:;K>N<:6C4;;E346N1:H>9J=140:574?0=>N;K=<F8557F0382;>8=6977D545@319LJM87M49:@3<??KJ2HON<7930BG341<=ONNO:<2DGFGG36J8>;7<8=0E3B25G>88:29I?=A1;47G?2M;:3?5>?121356>>=89==488855G07?790;;M9>417;;4=678;:;<9>>01234565N133:H=8646G@C@?0L8;4;><83F@4=?C<J885K8J419232GA<0NM=<6IE55BG@54<=3=8KJ;AEAEFG33;O=<>4MLB263<30C98?<N;MLDE@74>70I82?=>;7327715B3J;<HH?O=1C1G<C4598:3<O6>EB274A1AI9H>=NJ;812;542738=J>9J=C715AA43?1H>MH?L98F74206J8O<ML8N88FG@4DEL1NIH?<<E62674DDL=:0=:H8F4510A27?9=N:KH<0121==47:::9<9:6B54;4F22L8IMMI6JB22B437CJ1LN8=5>85@624>489>9<9<97723676F8?;J<=:792G2@36>99<IHOL:52;14D669HK>MH;;0:3;<<B5=JH3=;OLC7413=658<8H:<O;08;A3G6BK0885:?KB2@:B<47<KNIONHN4463?4??08==89H=92C@5<218?;:=:?=2@1:@=>391;3O<=79E72FAGD==3:4<7?2435116<90H?O?MJ674317E7>8398;M;B3071AC7:K>;<4>?0521457B99?:8<>705035@?5<91:5O7;67G5@2D2:>?=94<;256A65E2LH89N;>K20@5466C10<;:47J1003=3?>>9>:<6?5IORVP?BNI5:1<3??;08JJUSS2MCI0=4?>0285?OIX\^1{ho30;2=55=62@D[YY4xec>3>58692;1CXZ_UU8GKD:7294:=6?5OTVSQQ<CGK6;6=0;0:3B6<32;>8O9<>NC345E023=8>=I?9?01214F558OKN=8;8E25211638H;;>=>KC763?4G2=H?;O>=74C77=G03K:2:5?>>41F745>78=:9<O?>9E6;71E689<?<=>?0723516<9H3?M?:7406@A5578;:M>=9MF163E50F;ML25>JJA2:17144N=:>>4:N53220002<91:ML?L25:G6<5699II58?;44323A?E>HK><=H9514;F=ED=92IH=>>85D;157E88:?<6?M9BG1@D51;83=HN<?015EB032<OI=?<<76EA453D7<1938N<95025<0460ML2I;:?;0A0<2G01>:H;K=J69:536EA=0=>IH=J5GD240EAKJLJN:<:D7;;BG6?0K:=?=8<C5285F3DN9<9OL8I12:60D3>JMONIL>8E2A510?BJK9==5?>19;6GGDFKJHHH8?=B4D305=6K0NHH5KMB8F02D@2?9IM>8MKD04E213C9MO2J4KJ567F6D4E18N>:87IC012G@5382;O>KMN8EAA06E2;<<IMH8<84:;G6650?2HI<?91BC@EA@BN><2:K6L3@C;6@E6>O>;7<J87522E5E7KJL>HHKJ573E3C1B>1III:<J49G635D7<>I<;?MMABA0723481:N?9>41D3F@GDD?8<O89J=900A<5639J>?986?61AEGF721<?H<I8?0EF6A2741:39<5:;4192A@G4>:9NJHO757F31GG>>1I:N>M<0BC23=>CL0?O=;L7F837@ABAK:ON9N8695774>47:8924==K3123F7C7:93ON4??1043==?F=0;=?5??00@30101;8:;:=8;DC3A=<273;:<><H683700D>6?0L:?H<L620;GAC0L;K<?=68D2C:742390:9><><DGD42210>=:0>=M86E4027?6=8?=M:881212G@02?9;:4;<J586F03G1L0325?K=D763@2010?388=5=174G37BD=;>3;=M;23@ABCB3092J;=?9B1:;@@5789H39>6?0215G=C>1?2H=4O;0:0230E0J13H85MLC835@10A1:;>HKJJCCG77@3A8:N<H?9I96G3=@2089KJ:4::5363?77F<933>N>;6E01G466<?>38>::C@D4FF>50KLN;4JIBD1@0G7DJO<=<N:77D@A316<:8N2HN:963;AF611M0=M>N9MF9A0E77?ML=2HILLF9:5F7DELL=;>K9>B2:BAF0><919>8?N6151156?IHK;9;;61B6345DE<1I;NN<6B9200D64<9:;>:L7464:F047L0;?<6<;C802FG54;;NH:;J6C0532G0D=0:8=?7938C0FD2701OON979EE@AFCE5KJ>;N;:?;373<5058;:J<?:608234<42:9>;>97>09:32D550O>;<;J=A@720G25NK:;:HMLC52863@FNL9II>>KF@D4F<C0I<LMI9967237@DG6K8?95NJMFGG:@<2BJ8;J5K87D5FE05=5?;=:O?6;21G73G>CMJ=?;>6IC2GGB<@EL=:NO=7IC6@7@6G6<>?II9=<717EF0@3828<?=O=62FAGFGFI12<=?<;2C1AA1?FI<98447?23;A7<76=1I<>;LL7D@7AFE4::>;7?9628;0<G>B99?8<?;?865B0<??L9NM<=>;840260E58JK3H9<899:2A17581H:89>4281B566D19:MNL:JA62G6GG5=K9??N;M034G<@>0>?K?I9<97BFBAF?>M19;H?=?4191E5>1J=>9:;??141;4526=0>=<5>62E;@F<7>:<::<=O<7EFB7<7>I8>9;K8908474>4F90;N<=;<8GA;E067<99=M4;6AB@4E104L;9N8<7JA14A31278?9399;:A63115273;I;9HH:4@1@4C1A=O::;H><F4:34610KJL=I97<C96F<C31<=;3?<>77253E5>30=:0>IO95B0737D?:=L:<4LL586@6166:93H<<O?E4;;7567:J=8N>79C7221G>2I8<88=5=E51521230LLM=468276;@GGDMLNI;;K=651:FFEBN;NMNK8944;7F52AJHO<>L6;0:0F1415M18N49;?71234D>3>8:;9=>J85GB5=64J1H;;O76E0F@30DB>=;2::::9663?7CE8K9?4N>M6310325>J8HH;>?622;11<4D0=O8;O9NC062GCC1=LO<:I6<CC2;716<:O924?M8BD2:EA2F;;;2:5>865:B61?2IML24KJ=B07F252E=;L:>KLMC932G<34<918<4?6014305701:9?8?=:95;2BGGE>:L88;H?C4G@<@5F=:;249L?9D431D57I9<?<6=>25:560?5K9IO<K>8A35B547DJ1:J856?8B5@64E58<:95<>?002745450KH8NI:?;2361540=8<>9K8?062F2G4D=9<;5>86603020GC9L989?==7203767F=82:4==?C52874039;I?5=>I654B73048;<:HL>63170@<>A90N9O8L9523:1A2F?8KJ9;6=B3;A05=4:LO?ONMJCB47B2C1:;?MO47JC76@7G0CL>NNH=HK7BAFE6DA80K;<;KLDE334<C3829?45:70733E<7F0<;N49HI095;7C>6ILK>>I<IDB0145DD:OO3=N><56DAAF7C0>>;7>:6730:GG?7<=H=I:O8873B41G09;KJJ?7JFCF0=615?O;M?KM=AC3F2F@2?8>>;9>435CAAG?CNHK?48=611A:=33D9<228:>71BC75165M1O=9997725E36DE>;3JMH<J419014>??<=JO8O;2EGA157AM9;;958=48C@5@G18M:3J9<97E0;0611;JLH5<7?C1774>52:JN:HLHL902@G063;:>OJ4K9F0D7B666>8K8:?7<CB7@GC7DI89259KK28F00D273:?3:<O?0@4257G6<1;JJ<O:0@4341G7=;3::?9=26DE4=451K2<?57J0932=D4?I=:0?8765D1B@C?B8>OI4;?J3116F4CA;LL2?8JNFGDB5C?3NMIJ9O6<3G37557EM:;38=5<5B46616E>8:<:=89A31@A1EAK<O<:=8<A0A1E@60LO?>9=>832:A@F6?8LK;O?=;0:15@G3E?KN948>?19AE=601:8I=4;=?94C47C1EM>>?>NL>3233F<E7JKH2:HKI1763?60B8<>3H;;IF8311D11=O:9>=H9EC;G5G560;>?ON8LA3AAG<EBK?3<5N?;EC0;@16<;>9;5N>7317B557??>:<I>J:7EFF0<56N8N2I49N8G14<<>6IKHM4I9M6C560<E4<918;;K:10023@67J?8?M98MA3G7GF77J>82O><9F633B72DNL=3O8K93G137114?JI?<6=76CC30@@>?H9M48;>D@F:@72F0M8>5L><EBDE1DD?9K;H?<JID@G24467==>M4N:?;2;AG@@1JO>O>>;<2874003A9J2;=<;:2534=A3>K=I?9>:KF60:2<?69=<HI?::05287DD6N0:;;O6N7G0:73B6>;9?J4LI9C4AEGB30OIN;9>;7B3F36>D=K9;?H6>5CC405=4IJ238O?J68335452KM:3<=<=443E65>?<JII5NJ=02A20427:H?JH?7<C2@BFD?3829JI;<;C86:77?5?08?H?>?25AG26>F88I3:?>?2212=305L1:N<86?5706FF2F<9>;7>L6246:1153<0<3NLM74062G<6F1J:N<<8LB36F@GD3L;<<I<?874DF@A0F:OOI?9>43C;BB573?KNI;:=?B5G25A?C98I:H=M<C7G3F3@5<;=:5467ABFGF41E<M2:45<J4190F<BCNL>M4>O:6D310G@2JJO2N>:IC@C53@2>J:K?>H?6196A2F?A8>9?5???42474>5D89:;<=>?0123456789:;<=>?0123456789:;<=>?0123456789:;<=>?012345273:I99<=?1G@1GD22=?8988=?89:6567690;:9N8:2C07=642::>;>=?>00;76A418=:0?N;93B:A47E?KJ92O;:KDBGB5GCBJ<O<?8=I925;2422=02MI;=;EG3345701K9?8=5<C645A35CJ?>3=NL<9CA;G3>?;8I<>98<30:5GF7EIL3O:=6N5EGE4C@590I94N?;0:1G7F@6JL2H49JKB123133?09K<;;K:C1G27401M=3M8:?>9@6@E4569JL2;O795D63?6BF9:3;<>J8A94A6C>00MN25IOIB62GA4G61O9MN:JM3C:FB704;9:<:;:LB0;:=16<;MK9O;:741A1GFC?98?9>O:=01:3=0C2I=?=O46I4C06ADCF<8:===;;5107216D<918HILI49G0=C7FM0LH<L9LAB0A00720183;:J74E621F1F89N2=H68F45F=0D18LL?<6=I1CD403@ENOI89>K<7340BC5?I>3=IK=6E2DG3A@BJH=MJHHIBG34EGGA80O2<4j43r3345`s:<<&89>441@5G4>789<3<=6?137@30279HOH89K7C13B<A27L8>:>O<:A1;E3367J9I=JHM9419751B2;?K?=I?;4C4@0343I;H;<>89D9AE2253I=K9HN:95C13<105KJHO=OH6CC:74>2589:;<=:=0123456789:;<=>?01:3456789:;<=>?0123456789:;<=>?312301273=8;<9<?012704E3<:I;O>M?05:344>AK:2<O:M?01234560M82;<>6<012347630=:08?>:38@733C48<H3>=>J46FEEDC?L<N:H=9=4EA@7CB0:J>M4IK:4701E4BC9KK<8=5;40C3GF610H:3>>H767:B45059K=<5IK<5GG@4527=9>=5K=;874BA@11>>>8H5M;0:667CBD:;;2O?<:E502F64781?J4KLID1A76452J8<?85JIC305A5?E;=93M::?C263?103K0898?>?4D2BA=360L:;=I?=4@556=6688;>H?=L31656CE78H::8L?=1216<16<<?284<:962DA=46>>0N:H;=>A871F6>6J>L=?8O<3GF0<A3DN8?OJ99K045E3C@2<91?:LOI6BDGG51>9HK2;O9;18;6E6D411;N<;J>A56G72761<?:5:LM9833BFG58>>?<6:80461G7C4K>28M9M=46444=2D=;NH>=7K61G:1ADD80<O5L>>70C26A3FJ03IMO:?;55B<@G39:K9HNH?BGC;A@E5;82ONK=L4632<27E;KI;8=:JC57117G30<888L89352802D5IOL>N59NA34BBCBC;8=OIIMIBEDEA4G7KHN8N86776FG6C03?O=OJ::7E6AE05=30=?IH8L=42FBAA4E:=22N>?<A27@1542:HLO<KHM77DFB625;:?MJK?<2GF:6C@382>2=8M74E4@61DFN<92>46>4BC;E10>?L2M8?>>157BA226=MI:>?O:F13306568>>;7976D6@G<3061LO>9::LD35@<5B41O=:I;;<FEAE5G51>>9<>>=LBC;;@4C0J:9;J9>448D04141J8:;49<N13@11407L?N25<K9C9A;5D@E<J<?8=>:43374D53:98;H5:L4197E6C281H?5IM9BDCBF1@4N9IHOK8K8G75<C4CI9:NN>6;A6D6772>;;9:55>?00274>2E?8:H5IM649D32577LO::H56?C5670GC?0<>;:?J>0EF:7C57I?8JM:HK235@0F273=H<>N>7863G6174912N85<620;@7=E58;?2>=:70E47<00>8;O?H9J90C474F>4;=:08O9NE2675<438O9H<<9?E122@3EB?<L;8:;K5@:B=575J0HO5:?:3@@37=CA>82<8=5;B8:4E2>FM8HM4=>?5DD035E7?:38;<K?D2G6GC7B;?=<?><<71@A==B60:;I?=H;0:6@7=5?>=;N59>922CGB7>DKH;?NNM?7027G475JJI2<><L49G:603><JH34;O90563?1E4K1N<49<>8744B043KL8;556>201GG<7710I:8::;91356563<J2;>IO;15;5216<<JK9;?=:2603FFB>89K=H:7MFE;G40?2MJ:O<9:NBB:@G7>B1HO28;K<D3234D2B<91?I4=ID2A266>ANHLIH:HKF444BD>AMO:98K=<AGF0EDDD>K;;9HO70351@32?1<L?<6:JA55E=D1B<?:3?:?9903A4A3?=JO2?:L:3102<@>C:HN8;:9JE6F0F1DD=?I95L:?;5GG0DC5J8<><I<>E@DF44C0803NJNO<086E@1B08<IM:O6;AD021=5B9:939K6955280@@>IM2<;?9L48AEA2E2LL3?>O9=AB5E2A?0LL;35?>876DG@@C>MK;:=?<N4D3;05=2:;294?6?012661G6:=K?M:K;A404A1G68?::<;>8C2:346E7:<>;4KK=4123456382?9;NMK40;660GC:0KI;I=82B2A13GF8H:=9K6MDB;31621<>2;94KL83:35<47>1>;78<678751=7098>OI98;63:70D30N>3>459<FB6A603D0HO>84LKD0C;3172L<::49>45251F24E<1>N>K<965@470D11H?JN8==B1:5FD2D>;KO:I;9EDAA@G0>0=H99<::41967=B6;=;:9I690@FB12D2J1<3I8:<92@2A67B??8;:?;877;4@01B0=<??9>;21G74>33M93J?59851035=?799<3<5:?8121=2E49;2989<<27F34=B6N;9>=L66FGF4G4273<?:5<77C97:45678=::>LHI4G@32557?J39NO9<2320FCBAMOLMJKHKFGD;3CEAN=:098L:54A162>689:;<L<;816G3A??MK33:=<832:2<D7580>M<O8:14216FD389:98=5:633F2732:;N888?6BG0@705A0HK;?=L611;@6C?10?KO?LH:7@D0440C18<;?8:;0:75<3E1KH>:N?<=4B:;@=22>J;ONK<?DB03E3031>=?OO?>B7;:7643>L3<?4M69963?00>1?39848<58@;A31F?L=?H4O?FB730F>3><<84NH84@3BB<7?=08:M:J=63;;=16<=?L2JIHJ7E47G4@3M8L>:9?744AG52C?;?H2;:6?412@3540::LJ4H9L7C@G2C61<91>;?;JA51@A4>A91=J=IK;D@CAAD?01?9N?L9N97@;F2EEK93>NHL8CD65622C1HL?<6;87465=5>>N9>H:?=J18123G2?>O<>?N?L23AB214DL?2>O<>JE55F@A01K1I9>;:?;454<4C>9>23<9:=12G3=454112=J>=8D1426FG1<?IO85HL59GF32CCL>OHIN:965281=0618=2=4=;4@65<0ED803;4;<N101102?5M><:N;J;1B2EGF6?;1I:O?9=10C105=21:3MO99L921F5G6FMO;9MN6;446@E11E89K=NHM:410BE5>E=8:=I>>95721002382?2:NJ7B5@62=G3LOOM?ILI8104E625:H?=M?M?02G6513?:8:?NK6K6C7G<5DE;0>;787MCDDEFG0?I?LM9?7M3C2G=7?089;;NOL9C6F;37259;;;I<7?E0A@G11F<1?NM9>458@G3C>CM0LIJ?9N64FF1722JLHH;ION0@53@G15<9H;H<=917;G32B1<0K85HL;4196=C>00OIM9;66FBDFB62ENM?9JL<;23C62D5D989?<4H8801342@?L?H>J5>IE8F74>3FLOKM::<93964=0G0><<I;8=K224:F<CE=<3>NLO823226A@?LJLIJ<;MF54G2@273<H??5J815F7A6BC98?N4OJ>294FEG3AI8N<=OJ7F573<GB3JMI34>6I9E04F035:=:09O;L1E;G04?4M=:I5K:62C2F4303M89JI>;ME7@53DE?8<=IHLML147E51C>8?K;8=5:BGG6G@>19H8;J:?J8111=40F?1L95NM:4772<106=;8N8H?;98:G@02EK9O?<O8;0:7F56>3K092>=O>6B;A2<05?;NN;L<649@F<D@B089:<<:9B9CBA0C2<0LJ>:KIBD63?0C5J8K8I<8768G2@61EKL3;:O6=F522GGB3>><:;IL<4E;F4F>7J<O=I<>?62G@016<=O3HN?;N3712=32D:9:;;KH:746EG356I0=O8K7<994@75EA:=928;<:64:GA<G0<91>JKK9AE1006??>J>:<>7<5315F3C1M8;I59>JF54B<CE7>L<3;?O993;G15BDLK=?<68?58G077E498?9=H8:23;35=35L=2?N9<<A8:;53E>J;<J<5M6224;A<@?8<?988:?;726@05F=J3>9I;K1531B=519?;<M8:;47;45CB60>>?>L8?FC27001?=>HNON=>252825>0N1H:?=H?453;G5G6K929JN>?5960B0D3:JKOH4::5@FA@64?K899=4?>0EG205=18H895O77553F2CC0;=NN>?6?A8@63CEC=H3IIKKI7BFB1DDBJ=>MH:=K26;7@00382<;NH878E32F40C?09=J9L:5D2F757EIM<J5;6?2C745<409M?>H8K63GGF1652MO>;7;=9CEGA0GBAKHONJN8>DGDFBG1B:?8=>IKI2B@:B272><298KKMF2D4FABBIKH>59>462;046GB=:==J;8;C6311355K83?8=MJCE7405E0?1>2H4=8460A6542?03=8K8?41957G61=O=O::?<23F5FCD5J1=>59=<93;@AF40M:LO;::>280B0D3FN98<<>MI4D174>04NJ38II7=C@6GG37E88<85>?7997@<=@79?2;I>>8C50054E79;><<=L=8CD:F1273??M:?9N14G2401FLLO<N4K=7001E0>AN;H24O?JA4437<6D?L2M;<;760:20@63L=:0:;<IF4FE=FD68>HI>>O<9DD4F<3B?:=9>=>;49FA@F7?N0I;HH>JF25:FC2><1:=8=5964;2E63FLM8=N;L8E21@E00B1H><94KIA6G5<C??IL=HI4;?7676G22D<::94;O;0:45GG04;K98;;JL637GE=G70<<H84><93@43<C6JH>;45KKB5C5GAD>JM>=HNM?B363?313=0L:M5M<252EA1C1I1N;>5M?C1:;BF@3?8N?<=O>9C1;64778=NO=?<=130;<16<>1;J<=OI8E:50A>EJ?N9M=7>6B:B=G428H==N5O676D;6@>ALOHN:5H7E1D;@C44<91=M5;:EB;7GCCD<L::;?M:9@5G402A0O3M8>;9C231G763M=:I<8K=04;742E?LJ2?<68NA2;7E=03<=3?44;:683:6DC3:HH><5<60@0@E0?E<M<NJ??<55:FAA>1<;L9?<:?;7@B@44ALOH>>:KI4G:4B1G5;LI:?NLL0341@=>>1H9J>4>I05D75F74:=:?9O7IC5282F07893HM?6>ADC@@F70>;3?946>B94:B<5C>19NMK:NC6GF1726:L2>N;>M90AG05=1KHLM>;<=B9F65=@1;J<;?=:=40:;BA52?>;35:>K24C04FB7?:;N9><KB31347B382<HHHK847:5<4B1K:;N847>C@1473C>IJH<9>?JC7F;FGEC<<9<=5??1DC11A1>:>>;7;K;37G501EA>J2O4;H>25FB63EB1K<=I?H;6C@723C5KL:=4;8>B5@31C65N>N;<9>46DG7<D7DI?>8<58?DD427434>8?HMK:L8E3:5563KL3H:<>:D9A53<3E>=2?8;9K4195B3BANO82OO9?FGF11D3>LOLMII9M3G5F<G2DM?LMJ>KI9BG@2GGB=>KIJKHLED474>1789:;<==?090341G6?1:;4?6I082B4F560JO:>=>>20516=049>39>>:>A3C26=273>;::>;64BG@1=04N9L>:;<:E302@3D?91:385M9B3@F61GF:HONI8J>86035FGFM=:0;<O:52A@@A>FJH=2NI<8B6CE363BL;N88K?JF2C;5D718J3NOO?M1GCF2@BBMOL28=5834CE<2BFM<3MMOLK7EGBB=16?O8I;?H;29D6A61B=M<N=>?:7C;:GGB5L>9I5N9;0:56F22AJ0KM;N?N480:17@0MLKJ<H9LF8DAAAB7NK><IHHKCB1471D?9?L898M61263?204K>?MM<JM115A<33B=K2M;O7:E65E6745<=I=NIM>86;@4005MO=<5OK?01;7216<??9OH:ONFDGG7C2FL=OJ;97>AEG5B42B>MHJHI>I082B<A@4<M=IMI=:DE0130@7<91<:5>?812145678;<98:7<112;54@3;KI8=8O9016317009:39N99IEC5E1AE>8L<?<69841320A0E81894OML681EF44DMJIHH?:914:543?3<<KHJN7>0C310424<?89N;:?;655F14F=OO3<OL:A@C1E037I<22<9O>C7F@=<4>=;KI88==C7AA6C?0=KI:<<=:652832G3?J=85KH9A30A<G3DLJ>2I::7E8A47<DCM?=>:IL;D30772C0<828I<<;01AA05=00:93?=M8B3A4ECD?I1N9<>M<13132AG7M>8=8<HIB81G3<D2MJ:?J9:ND47E0G>382=345882EA:=<D08=<J:<K90933E224<=?;I>J<3D104C559H;3I5O>21F2AAE?>;>;7:7;1C42724FK12?IH8?A251401E=0IM54>N6103F=12K9<N;N;<BED:E<7A0O:>49>47C@22ABE1?H<49;<70A04G32LK3=O5H9EC6A0055<;LM:L:KF96B33D2ILNH45O94194FGB0N>3MJH>NB9D@76120M;H=<::DEF5747DN?3MJKJI63GG@751NJ<J<>;7F@074>1D??8N><JM25:2GG0EJ12H:56>1B55G35E91OHO<LNCEA5546CKJ=;NN<?952;45273>IJ5:8IE5:;@4611M<3;L8I1E4;E26A;>IJML=97@57GGD0;M9J:KHM4C3F<A2E?=:0;NLMCC0@F6>3JM:O5?KK117G43700<<N4=:;1007F67CM<2I4N>?1724B@C1>1228=58D242GAC0:K399;;7DCG2B2E3?9=N=4;L5B451G>691I8O>?M184@637CI1?J9H?;0:5G<F2D=092:;>?DB2@07631<K;H4685137=567:KKO?5>>2D03276C=<<J>>>M1663?2B?KMI;=>?L4564==@7<9NH<<?9E3A7760E88<===7N14F2BFE0MMO8=HL=3941616<?M3?I;KK81F5374A;022N4?J30A57G03K:<8HNK81@:55F73;18N>:>IC10;3=E0<91<HL;I4@:71=G><<;8=8L980CGE<GE8M<8><6KFC54@652;J994>9J946541D>L02?<69KCBD@1<5>K=OH;4MI0D3@@15EI>KMO:?9912B64DCJ0NO<KML7DAF5504::2?<::?;6FF2F4BL=?O;;==5BC1E=C6112>5>=;541BF54><<IJN<H>7B3767>?892;;>>?45283@C51?O3558J65A5@FBCM<3??;8;144421>DJ1>OIO9K7814B<13N993H5=7266E05=0NK;N:?885G5@6FDB88:8>IMN17@B@F308J;HNK9JCCA7A2C1K<>99I::51@F5D>382=MNOKL47G;F6EFMKO;==>=74C24<4708N;O<K:704GB5?DNLOH<?<K81266<C6I1>;7:HL8412E2G490L8IOHL12:0BCECJ9O;5OJ=890;<G600K>JH?<?B7DB=62DN?;3;9>47GD1=F?>8J3N:;<83BA4<526908O<>>71BA56D>F8M2HN9J6CG0E603?9:;J;5L7419;456789:;<=>?0123456789:;<=>?0123456789:;<=>?0123456789:;<=>?01274>>789:;<=>?0121456789:;<?>?0123456789:;<=>?0123456789:;<=>?0123452731:;<=>?05076543::O:I>K?2227G6E7K:I<I:K;0520A140M:>;>9<>836002E6K=:04=>;01033@2F81;3>=:?41210D75>;;98???09635127?L:39?>N4@61072F9;?=8=57016765>78?8;4?:;03274543I88?><<;216301670=:?>=6;21C7E143:=K:>9<;0::34=67<9>98;>;256365278;>J??:=13616563<9898=:=09714D2F:=>98L?=5@63?=670=8;8=>;216766C6M:O;>?:8E2A4A6E0M>O<I:K<0124A6E0M>O<I>M8E6A0G16<09=N;H??0171357?:9>;8=9J4@311775<;:3<5:?0963076?<;:J8L:=436B573F<913==<?81276120K=>8O=M<C521452AK8284:68852742G78>:<O=<;86G701>00=8?<66>21342270?:K2IH>7653E<4>7==>>9K>MACG177B5IH:;<5?;22A3FFEB9L<?>N:?;93F4=450:29H8:L28:GBF3>=:?>>5?8636306>D1HK<9:7>7G;6G225002:M?8;7528<4@49?=3=9877B@G2=5B==N?88;:E7A:1G3A:H=9O=M>92A5546D8;8:M9:7D1A:05=?:=3:89OM53AF@<2589K;>=<N897245>3L093M>>N35726F6DM933J=6N99;34C438228:;?=3@C;4<GE;9H?;498563@1A17;0=J5>M822332A6F:J8>8:?;34;GG2E>M8>;75:825C10445>MH?4=7L9@3245BB>H<855:K643B6343I93?>=:66EF@57ED993=89>485501642IJI2:4L=E@G24D73?1N3:;HN66FGAC1EJO=>I;7:8C4G47BD>M:M4=99419;17>00?:<>4M87C4@2=EFMH9;?>O9E96G22431K?28N:?7C1:G3>E<J;H5:HKEGA74>>19O2IO<763443=10C1;N:O=M8F165E722J<2?5NL850DE50D>?OIO9=LL7C:6612731<=>N78BB0F<A5ANMH9:I<<E95ABA?0M?9>M;;90BDG=6@?MLN9:H=?C62GA=04;=:04;K7ADA2A@50N?L>JKJ87G030C3BJONJ:<:L40A2B=3D;;LMN=;I29:2FC1BJ8N<8=5772AA13>AK:L;5=6?F5634AGD>9:;5?>>7333=47F>92:HNM;96;10175<1;>45:;0::;5656MM=JO9KID2:GBDECJK88::7?01745<GBI;LJINMI0E312D57I;=>:?M91C63?=>6J::3==6;5D4G5=05:LI2N;<<6@23455711<J8K>94543574189:J>K>=0B63716<0193?58;9D3707G4I8L<<NO6086B1DB3I<8O9;M:D92@EF3?L0<?94:;A3134<72<91348=8A932@1CA>JN2:;6LCE1F6@1F09>:;56KC@7E3@6?IO?9MK;=7724FC61LLH?<6666C5FF0@C>0H=;4899B@B45GF1H>8=4;9A2AF220F1M=I9=J74G1EBC@AK=KJJ::?;9;B0A240?=8;4OM892@5DEB:>3N4IO;B2C:435F8K99<K8:E415F=CFN0IIN4M86528<<D18<>HO:<8D3;1<5308<K2??875C4B74769:=:?4>M252FG6ED0<N8?<6>3D@254=?2@D[YY4kioc?3?6998136D@_UU8gmkd;?3:5=>57:NWWTPR=lfm1950?30?=<H]]Z^X7j`uu`?3?69<913M>9?D72B4DG4M>834K:M094:BD3B?99O=LK>7B2FG711J;KMN::8B473E=D3998?<66NB2@4BACB?K3HO:=:FBAF=6C4IJ;JMLO990CG2637M<=M=K;872136G07?;I=?I:?;9A5EF?2=H2J:<:?433636C39:IM9L6?A@3773B?J=I8=L<NB34G6D06KL288?:7B528<FG4KL3M>9LJF@;F6GD>L13I8?=L335@<@6288;?8=?N63DGGA47==O::;M?017E05=?KLHHN<68AD7G01CDI?22O4LK4D7BA023LLK<I4>K194A=C54=O99>>687@CG1173822HJ<:N29:FE@5ENL:;JO<KB573<5B3I<:H95<93@1A7<>CL<;JN4MM546FGDG0J;>;75JL6@25=537==I3O>8J40;:A221;1O=9><66402<D?1=0:2NL::61230074<:9>=9>48DF53C00IH<=N=884BF105268O<:?:>?B9FEA2@?0:=M45HI4403454B<KLO;KO=419:4571:=>35L??057G53E><=H;>:8<FG76053B<9:IMIHJ5CDEBC@A89:;<=>?00374>?5:;?:>97=936:61>?1=>;48:>312B2AD78>39JKL>2GGE6164?8L2J<7?FC233G27308?O<>JF@D0GG?E>;>3:8?=356@24GCM?L:9LL97G101D35=89MO5;NF@GFA=278=:059=;CBC00FE>I8II=KONCB7553>7?8OJO<?<F4051A3A>H>>M=77D727E=47=92H8=56475GE3E309O=H<7LEDC;007DMOK34KJ80D5:60D7;98M4:9I86DB<65AJM;?;H7;0:;610GAJKN8MHLIC@@EFGCC?H?H9KK6BE2F2D?6K?O<:<>?434:1@CE81N345?M1E63?<3C::K;I<7>ECA1562E0:9O9>J<7D61F53791835L??312B5=>B;8?HI46941D6016<1<NN;=9879@23F44?02?;L<<AD4A<GD79O9=J>H;4@:22731>M3MN<;KE6A@<6@0<912:9;?B66F=0G?>9LM?H:<4B46B4570O;=J4<<94:22G?6<O:HI59?C0117620I=O?<679620@7755K:3<8NJL1051A4101M2H::=7243;5<?0=MH3=98?66135@6D8;=<N;:?;84:7@5BNO2MNK?ICDGEFF@0KO3IM;M<7763@A@0NOO==59M18C@B5>>L=I;?5H96528=3?10=<;OL=<89C37@EE<<L9O9L80G3;6<4599:;JKHL7GG@710A8>3M=>>896;;05=>>JO3=49<CC761<63<?N>54=85422730BK:>89;?MCG:0701A0188::?<92@13=E3823<?KKK2D;AAADF<>>I;=L>20C;@36A;K>NI>H>A31;BG5E?::NHLKJ75G@264CJ=>;747?450345>1<H:949><052300200;>989:?416342C38=2;4L:?0467<6>0M<><O9>498522G>DJHO29>J?60DBG6B1;:=O9OO;D7F44<6>:03?8LL9F@1012>799<=N;;7419:E745<;II95:>31::033E:=<9?<=<0E:3246288:;?8??0C2;337F81?;:=7;17274>?F:08:II8NA1A@<6>0J;<<N4K8A0:1376?;:INI=8>E7664F>B<H=9I>M?86D15D2730I3OL>9A@26F35D00K>5L=J4D:3<51E:>K<<O>?07410F2FK=K;54;LCE:@E76?:=:05NJ;E47F2FD78=;;49<M03C4BA77=>:=HK7J2@3EE54289?=??O?CB2;4167L;2;8=56CEAB@F@>8L=IH56>24@@A261JO<O<9ONBGA2G5669?9OO;KIF6DG7757;99;?=>;0:;G@<35J;3;<>J8775AE0>6I?2IO9?L2C35EA0BJ<=M=I>;8BF7A10390:O>8OKF363?<C50JI8<N9L2470@@B4;>2O:8;ND0;7F7C1K8IMJHJ801D5345C1O2M?>KIC242E16<1L8ONNLI636:<D111128H:<>89;:613DL82JI97I00651413:;ON8:;K53236<CC<912J=?=002;<7?5:9H9?=H;4473<64D99899>>LC01@0F57L18>8HMN5323E4?39;<?<67IE3F2B713<:8>?I;7411632E?88KN>>=81G236<6F9>O:O9O;037;FCB58=88<H:?;@2@G12DK0>N>;:6250@A5>618<88<?<146627D6<0;;<?>;54323=BB09?O55KL8528E5B?M:<J49J:C731<07501>>><;I8G:;64E481O8:5<73E:F6G25113H<9O7B43005=F98;?:;M6481B6D1DI;8;8<>=406@G2??JO:NIN<694C7<42209HO<:;754:6AA?382K:NNK<3@F1@=DB<9K?I8LM7E5AF@E5KLKONOM7B7D;3D2F=?LII=L790F@12C3K?>;7L?IF2@F1@721OLOHHL=FCG@E@D??KHHO8HLF7G17A10M=NO8N7KECA:7F77N?9=?9>4A3551=3C=;=8MN68214;0526=MK<8O:J9E027FGB;;9?N>>7E0;54=GF;18><5:;419B6@3F>=H98<:?03445<2DL<8?847MC13G74620JN:4;6;A934E0>78K<>=9==80A74>G28;==<=>755C3555?<9>;?H;;050761238==3?H?7815B4=G3?J??85:;49770D273H?;8=68E647GD650=:8<9>;44630725<=>;8=:;036;41670H>;M8:;8567<023I=:0M8685666F342K?IJ;L9=931061?5L892;?6N69;GE4GB?1H=N9:LE5D7E1CF=H898=5N5E12F=0F8;23H?7LE3GBEC@?>H<J5K=?012;67?4M?HI99H?67;;AFEE9032;>K;0:C;42E4I8;:<??>AGAB6D73:O:IM4<7144G5145=9>84<:<D21:A1C58>3M>46;9263?D>EKMI9:;8:50:6GF22892I?4KID0DB2@?A=L2::<?;F81F5@1F:H8<O:<L726:B16<I0I2OH=NEBD4F@40K9:;<=>N8@@B=0429K9;5L8?B8FGG4?BK:O85<::8B@A16EF<91JM=ONA30A5F17899M99<N67DG5C7DN0N?9:6<14D;G4E1NLI?JHJMDG01GG47<18?<6ON8@CB77G5K:2;=?LIEC6:671?KM8<:8?ID83A@@22:LOM<8=J0E0:57G7L=3O5L:?;@CBG1>7:K=?=4>IB124G5E7:9<:4;OIC0@0E7G3>1<?J?8>19GG5A64IJH:<;<M7528EDGC>K<JJ>8>94FB261D>LLJ?H=9E9DF=2@F8;OH>;KM473:<DB?LHN3O<?=61CE05=FJ?KJ?5;88CF61FCD1HK94=6=C3:6F=E7:9;:<96<8@F647GD9?:H=>M80703F=7382KO9:;>BE61=G2A>89:49<8572@A6?C<0825=>>3GF1577?99<?I?HIF12:BG?>?K20MIJ]A=2==>GCL[K7==06;@FGVD:69730MIJ]A=31:g=FLMXJ0<=50?;8EABUI5;8255NDEPB848?3HNO^L2=>99B@ATF4:437LJKR@>7:==FLMXJ0807;@FGVD:1611JHI\N<6<;?DBCZH63255NDEPB8<8?3HNO^O2?>89B@ATE48:556OKDS@?548>3HNO^O2>2?`8EABUJ5;86=06;@FGVG:6;720MIJ]B=3=<>GCL[H7>364AEFQF95902KOH_L34?:8EABUJ5?546OKDS@?2;><IMNYN1918:CG@WD;0720MIJ]B=;=05=FM?9;>N:ME7@B<F45I92?4===24C3<03FJKHH9?6M1EF267D2:=K3H>=L132:505382KNO96<7B0B1CCDJK3?O<M668DE@A@A?0HMJLOIDBC;@22?;03JNK9:54:B@A65N<>;7LH82G45@F01>K92M;J96GF:1=CC1KI=H:;7D4G@61BAMKK=859>D7@;2A50LO;OJ9>4AGG6=@?6JO;:846641C3=12>1?N?;HK7D6G0E1CFM?;:MH?6A846@57EI1<I98K63:COH16<J8;:=<::15AA54>38L:?4?6748A5645>:9>:=;=L01:3<A00:;9?>?H?0033657C<91I?5=J6D5@7G568L;M;KH:94A6@C0A8L3J5KHIBD35@6@AJL29O<K?043E5@618M??<6L<8G77AG?718KN?><?213FA6?2IM<85=<=83C374EB;L2<ON7?2877ED36=M?O:O:?;C6A50CE00>>:8?8DGD6<C0?JMKON4;M5G550FDB?L=H;H9KF1AB@G>ANM2M5L9=B528F0B31LK2H:><6@66ED?B0>:I4H6?17514F1D;8:9MH7=53410<470=?384:=D32:05=E>9=N:?:;98134@2CN?N29NL92G41BG12<99N8=>JFCA0FA5381:MO4MKCGAEGC@382H=9::75EAG27GD8?<9O5M?04FGA22><J3HM<=NAD1171DE8LO:N:>7A31B6C2?IJ>;7O8J362026179K>:496>164;761>K1>9><>=D122FG26NK2985>97222A467:J<8:9>4B676@4EEN9NHJ;HK41@FAF71MHH?M;J>691:G<>DJL3ONO:=FB4:BG171O2N;476419AE14?9:>>?KH;EE@54F0EN1NI:H<97CA62FD11KHHI;=9CBAA7G4E<K;;?NM;6E774>DF>8;;=>?>00:;111>1<H:<5LM2ECF33@3I:K;H46744D:61>ELOK?9H??C@637D273KIHJ<7JEG0:=236K0;2O4M>3B4EF<CC?8;JO9JN7E;73FE01L3I:><<EG4@A341;=:0NI;=933G61?B;>=NHOJ>4DC04<CBLHK>;IO75G76@GD08=2J:4O;C922445><1H=8=5MEE00@<G>1OL2N:9>824:3<32L><IJ=ML01:;6713:MK?9O6739;2=6BFN93?>9;;0:@EB53AJM<JH5MN63A5GGC3;KNIJI76E8GA2AB0:=N9?8HME@;EA2B1??=O4<?L4118FP4?3K_XSD@IO528G5>D<1><5<:96572<@40MO=NN4M771C163GAK:?IIIL950:74101<9:O8O=L0G:405=D8KOO9KLK36;E=52F<8HJJO8ME5GF=C0B09?3>?7KD1A011@7;JK=O9J7B7A22D4382I:?H9L652E7322808:>LK6CB376<0B;9NNM>>:7C16G326??8HH=>K41FBFF40<>>;7N?;D415E13C9=>I>9:L25C1=560>L?3ON<J65G7E7BD<J?2?4M;C3FGFA7E182I>9>4C0461465:;O:>OOMC8@:05CE?9;3>HJMEDD34251=HK24=O=010;6<G7=;29M?ON419@5<2B;<33?;>NFC205D7119L?:?;MB70;735E<J3;M9>?E2C30AGF?9NJ<NM<76474>E6NOLI?968605AA72AL>3><<JJ04D2E626J13NO5<ID45360?0NM2=:;=6C1FF4=273J894L<?51644<42M;3J?8J7D1410716:JN99N7=40::<763L1?J;<>646A;4766;=:0O?=N8E344FCC11;35<<:6@0@5A?E;8I;J=:?210246?78L<<:87861::@G>CM8<N8=5L22@:@457KH>24<6612F0E7E6NKL<=N;M0B540651N0:8O;98D8555=?C11IJ=?9;0:A7G5>?J8K2N?:MEC223=E3L?I:4N=L5G51F51F:1:=?;:8CB646465>M2H;<?76563?F35I?K8;4O<83A5@7@2:>2OM=?<97F3<56D89>=8=;L07D723BC91I?HI9954AG016<K<?298:6AB473=1??1L>OH?;C747GC?BJ9IOMKHMACGE5@>4;<28;<L6EE;5A061<91H:?7J6173G37>><2=5??80B3367E5::8H5;;L93A2<<658J=;959<096;1=?68:8?<6M952C3146F9K:;O>8NC9:31=EFK88=I<:J18:GBG60M1;H?HM>502AF5>A0O2>=N:?;B5202>B;<>=4;>?B13B=66?:J<8HI>83@G75=7?<=>?5N>7D9F62G6CKJ23=?;>C528G223NM:;I<O8F8G:BG@B<>=<JI;?ACF25C6B=>LM85>78101<7478123M?>NA9:305=D?J?<J=6;114EF6D?J8O?;98<C12;<A7699>M>>M>81016D6FI;8J>?672@036D6382I<I<L=20GB55C40O<?IK=>CD@E760?M8I<=?LM1C103=76;=IMI8:L200071?F>L>;7N6?CDA3<D1A=O2>OH8:334577D3K=L85?>?18C01DC5ILH8M<?<1165A@22J1;O89>4C90A75001098:5>?36C51<1?>>>OHHM=D22FA@BF?1L>J?O>DDG525@AMH;:N<9:419@=C11:>OI==>773C66CD29=;O:8?>1D4@<AG7IMH=OHM9017@24B7M:<=N?>KCBF74>EFM::I5KK9A@0:BC@1N>8OM:=KFD6E3DEC;0<3;O7J68A670?B1K32=K>847GEBG273JH8I8?795:24163:O2?J<6;052244>38?2<;I6?0@23456A=889949?04FB01768=:0OO99E1143<C790O9O9K;03:15<E40J8;>N7<85G3@72B=?3H>H:K4E43F317KL9<8=5LB64EEG701L3==4LL7D5F=F?AL1::OK68DCC2AD2>>L295I:J63:55@7FN=9=M:;;0:AA=D5181<>::6;48;41D>FM>8I9N>I7CC;45E6J<NH98J8D0DF6@@3MLN39I>?AC63?FE7M9:OMHM<0122=1G2:K2;O;>92703=7B?<H;:<?:>0123457389::<=>=012;416<KJ2;;=<?6C:100GD:=:;>=9:2D@@6GCA;L=?4I=I8G154F441J>JJLK63GD;323F<91HONO?677167B7;1IH4:=<50C15G441:3J55ML09:377>5913H49:?D52@@163>;>?<6MK2D3BB42D;9??9?78A83AAA5FMHOMJ5H997@6B1@D09HH:O?N247:0<4B1833I9:?;BG15C@B8M89>5;=600@3D>0M1NMI48>BE:@B535L==>;8;6DG1F@726?==9?5:NF528G@2E><>;5I8I06;G35?F=?I84IM<BBGE42221H>::HL;E9D0@25DK>;?J9=<3@DF05=DM?;3IHJLFC1:725?9>2H8:8L37AA24@09::<J;6?3G443012??9ON?J7C232<@2382INO>>?0G60654>J:LN?K<>1631=12DI<>O=4:?F0;0652D903H5K:6674AG47E;1>;7NKJC14GE@EE89::9;7:88F6B700IOO;4;M7FDF6@@26LOOMJ=<8DGFEB2@AJOHMH9>4CG307G@3?K3O?IO;6EF5@G@4I1KOOIJ<DG3233B5NL88899KFB46A4BC?KL8NH;J419@BF5789L??;==B5;@7<15;;=;O;>;B0:7@4?38O;I>L>;44;AAG6?0?<=59=MB2:26>EOMJAT@DMJNRG\P\VB<2IGGL:4CMIA=>EHEDC_XHJ>4:ALV@Y@MGOYMYG@N^KMBJ1<K[OJXHJ;0:F3362E<?;J?;770532AG4F>J;II:8?2806<210MO89;L6I6D:7B22D<=9=<46I6663?A7?NJLMJK=IFD5E=C@ANOLM4?M?B5015773?8;N<57?4407E50><0;<;9K962D7<16<L83>H::7912@6<BA?O93=?6?A850<FBD;KL>NOH636F0E1B>1JO9MNMK96AFB7E0<91O>K68344736720:3NJ;H982A50214NJ=88;:K5GG011?4>M?;4?=N5ECFF@DCJJI?<6J9B85@<3BA?M3IIIHM98G02G01=1L::N8KEG@G@0BA?;2O:?>6C971G61AM?=HJK:?;E4F25BD>?;:98KL9D:3B=EBM??2J<7LC477F7E1?J98IIMKA71AEA?6J>N:49<N7528@2101M=I;4J>C67GB=14?1O24:?6C0CE7=D6J1::O:?K192@A=04?9KN5N<MF2:@05=C?M=<IK;J2B4G3747JL<?N>M9E8GE67GALOIH4=>:C3DEBCG4IK3JH<OKFB2BB@1382N2;?892B2G74C4<L<8N>?LFB4FF1D4=H<2N;9K846;=@05MH32447N95D5<56ALK>;7IO?0GCGF4B4I?9;NL?7042570BB?MII=>L6B94F4FC1M92OO98<30C017@09?O8O9>4DC65<5?C9<N:48H781;16<D6=9N;9N6?80340FG19>9I549?3EC7230519:>O;>;419GGG25M1O<;??=A4:;07629H:<4=>811;B4A>588<=N56>0505454?<=:8=9=?49074>BDL=?=<=?:817A56GD8;3;<=?JF905561B<LH3::M729F:321ANO><N;7?312;@A273MN=I;=?C07134C30JK3<<778777BG379M?85>=62DG420E6MJ3>O<K;D94E5=G>>=:0HIL<A50BG=601>LOIK:KE2GFB2CC0J=8<:K;CD4B2670N>HM>8J?76@AB55FMH988=5KDC@4F760MOK:;=77E155<1>79KN?9;<:A24AF345:9?;:H?819;2=32F;8HNH?<;0:FGA3@D0LHN?K7I3B1GBF0B0O:<NKJ<1E73236E9L:I>8>9A410G@6B;=:H;N9;5B63?A@0L>HM?<M9060ABD1>1:32:LL8DE0E7@C3893389ML9E4@B<C20:KNO96N53D1===CAH6;6=09;EKB858?3MCI0=4?>79GMG:7611OCL2?:1<5?AIF494<7IAN_SGD<>BHJ5:1<384DN@?4;1<LFHT^HI;0:G3=1>?9>I?5;K6DD:FE4@?0O<9;O9;613323?6KJ>>>;JLBBAE6FB5N9:8;>=L4D63?@77N1H3O<>?331465DBJKNNNO6>DG30BC?0J;?9I?MM4G04FD6>9OHO<=>=D0C5516<M88=9:<8640@<C6D<;8IM5M=8@2EFG>>;K:34<K?0520@AB?0=9I>I6JB80:@5B?<91N>49:A34;2D1FM9834K?;0062F3??M;K3>L6<5G64<134I8N<>?MICDF26=3>NM=?<6K=E1674F0DJM<;;9?IC05;215F0<8O8L<N0704G3>?L0:>N56=536F5<7B?0?:IL:?;D10GG300MOIJLHNEEDG166CM1LJ=47=060E74D69?<?8O?7C60E=C2398<H;4OKF528A6DB>9=I?KOL5EF0=CD3;?I>NO9627F4BC@7;LL<4:HI571@7CCA?1=2=4O7391G05=B=8N?<8MNF62E274CL=?25;>=D6;24AEFK18:8O<N4321146D=099<?M7B047G=B382O=>4LKF81G3C3E=KKM5?HMAC643@?E;8?ON8O<11AEEFE0<92OJ4O:45@2A01FN?>;7H9<D8F5@7E5><2>5IL745A1G4?2:HN:<?:>112231@B8=>?I;9?7E:3E5??L1?399>4E6416@E30<2;4N6;1E47F2508=;MJ;6712@20<G39<9:M=O913DA51GB:L?I84J;419F=5E?M:2H4H>;79CG<G5?0O3?44?L9750E06EK:8?;5K?82240330M1O;IL;<BDG74>C>1?3?;?O71C:05456<=?94K6<1@C5G6459L;8;N?J9B444@41092J44:?12:1<A273LK?O4?=57:346DE<09HI=:IF1:5G4>?11:;9?LI6@@BED4AL<N=95>?0132621BJ=:0IO7662611F?29J:;>46I27C;<1E4ILL;HOH:38F30@>1?LH=JO7:7D:23F448MLN8=5JC3C3<430;:;H:NM?E22;<143<0;=M=JJ27F7@743==:2=?7?416B0<479?23;H<;0:GFG=?7=>3N58J:A1C603EDKMN?489854:BF@1DI:<NJ;9N71D5E=120KNJ<8<K5C63?@@48:;9M:=<36AAEA2?;1L?>L==92:6=FB6>08?<I6J640E2A15L1N:5I;9DE55316<MO9:8?L6935AAD@>1KIMN=8930;E1GBA:LLMN<?987433D14JL3HN5;LF7G@17B7<91NJI;694400537L=IMIN?96C206GCBL<?>?LH?34:0416?8M3OH=O=E8;7<0?40::?<6KIEG;1G7@F<M2O8H:NC94@6214;1LJ?:LLDE;G021?9LNIMK9IC11@5GEC::N;MK:?;DDE0CBB;0>O<H?6B7DG<<7?>J88OK>81D4E5FE?N>LH8K?J49562G6CKM2NH;J?C29FJD5<MGHi7H@PEBA\V@GCk2OESHML_VPJP@273O:;<>>NFE@4B74B>1IIML:K9CG4265C;K?8I4>J4C310145I;K?88:MABC6E=BD1=:0J=O?9B64B75A:9LN>LMIF4DG7DDB>8<<I8HK37G2@<14=KHO9>9:C0D4=GB7<;>N8=5I11624DE3>:HM4=M6066:52C7>>>J=?6<0DDB6=6BJM9:?<K;85C110B790;H:5;;0:D2E=EDNJ:H;L?:BE;F3F42=>II<=LI24:7A40FIM;8H:KKB406E=3FJO3;O=?<6E63?C42M8<H4:M:D113<@CD=;I;=<;>4C@@56GAI8:944<;D1A4G@1408:>NI:8A02BE16<N:9:946M376FB7129?IH84O;670@1@3D1;OO=9>K9714731F?198MH:<47;;6612<91M8=L701DAE43>J?NIN?79570@F3458LLII47K2655E7658=>O5<>>014E@746L::?<6H:57;E@@6?19<<:8:=8G@:A3@?1OHM<IKNA7250350JJK=?KJ?2D047@32=>L;99:?;G402<30:J9IN5ON18:7E=B6:O=<:H<=4DAFAG46N0=MOI8L0BD23D63<LI9NOH?5528B3021<?I8H<L62FBG5600??9H<>>21;347??N>ON?5>?93676D@C<9:IIN:<C12005=A?92:=H?8D9A47C7C1KOM;K9J83GEE@0D:M8ON??=6127@=7DI?=OMNM<45D500>382L<H>M9CB:@3=26IK>2ON;<8D:B37@5M>9H:9J=DG1527D61=:<H:J=98AAAACA;L>;7K9I23F1B@7280HOJ5>J6EF4F270=K=:O;;<1B1B<3DB1O;O;L8NFE7EBG1F;>K=<9>4F6D4BABANLNMJ;HI7GDFAC@BNLLH8H;>EB2;<=>30L;M>=:9355A23070M2J?O=6419E<1BEJK33;5M:5574772B1;N8HLK61E51=DE0>KHJH9M9EDAB31BFJ<ON5L?85DG74>@?0M?;<?8=8GDG5647;9<=O5;?F0250<@59:;2==7=091;33269;:I?;<>25:37C273OK?J4?614A5EF?C0<=;O?7=F02;0=7?10:==?9MCCG32C@B1;NJJO:NAG@105B?0<1MMA]J419EFG?BJ=:;94>K7G;0=C@2I>:J>46>7EA1GF4>J?=2N?J8154A@77C<>OM<;H8D4G74>@ENOOMJ==IFD2EBCDAIOO;JK6?795EBC1ANO28J:H77120BCDANOLIJKHMFG2EBF273ON>OO>8B7A46<D299K<4OKL5G5@3D7B?1:2J<786E2G@606=J;O>:J=DG7:2G@B?=:0JIJIFGDEBC@ANOLMJ:HIBGDEFCBD8H<ONH8I8BDEFG1AM>K85O=KFCD0F@@EJ?=28=5IE3C@6D>?<H2HO:HMB902G=36KJ39N<<J147:7F6D8;:MJHK?6776<0?7M129H8L;0:DE0ACENKNNN>99DG4;@0CBLK?NN9J:AC7A7<13=M==OI6NDB7:GG57K1KJ?>K>5463?C@0KJINJH?697FF7@B1L1IMNK?770@G==CB??>=>9<965GA6@540KN;<46<8714516<NO=OONKI413:2F>408<>4I6741277G761K2=M98=46451=77M;8;?=>?153366E4<91MJ:HIF6F63442:=N?M>>822720G4E;9<?M5:M4661@1>39<8MN;?>105BE<B>J>O?<6HI9GDE2@5?08I3=LHKCG0112@C<O2NH8<:7E2F=G>78>8=N;:9C9C;A066:O==HK:?;GDGBC@1NOLIHKHKFGD63C@0N>LI;KLMDG@GBCBENO=3JKJMFGGG@C@ALOLMIKH9F528BCBANON<9K?;5364B55F8HO<J<K>EC0G1D?>L;>?8<>7C7C6GC@C?MOJ:LLLC36205=ANOLMJKHIFGDEBC@ANO=IJKHIFGDEBC@ANOLMJKHIFGDEBC@DN0LMJKHJFGDE<4@382LMJKHIFGDEBC@ANOLMJKHIFGDEBC@ANOLMJKM=513:G72380=;84M=B3F@<A?4K=>;7KHIFGDEBC@ANOLMJKHIFGDEBC@ANOLMJKHIFB664623:J>M5<=?931;AFD5=;:<>9>4FGDEBC@ANOLMJKHIFGDEBC@ANOLMJKHIFGDE@577L;;2946=831163BBL9KOJNL7419EBC@ANOLMJKHIFGDEBC@ANOLMJKHIFGDEBC@C00>O>4L6D2C@GGG4N;=O5IM690374>@ANOLMJKHIFGDEBC@ANOLMJKHIFGDEBC@ANOO;<=>L03254F678J:OJ8>I69C6<5273OLMJKHIFGDEBC@ANOLMJKHIFGDEBC@ANOLMJH6741A36=05K923O>8J18AE5A56==:0JKHIFGDEBC@ANOLMJKHIFGDEBC@ANOLMJKHIEC;B01EB8LOONOLK383G744?IHK88=5IFGDEBC@ANOLMJKHIFGDEBC@ANOLMJKHIFGDE4547:99?;5H>61D76C?F8?;MI9:;0:DEBC@ANOLMJKHIFGDEBC@ANOLMJKHIFGDEBC@ANOLMJKHIFGDEBC@ANOLMJKHIFG38C6=@FM=0ECG[_124?LHN\V::;6GAIU]362=NF@^T<>94IOKW[5203@DBXR>:7:KMMQY7>>1BBDZP0658MKOSW92<7D@FT^2:3>OIA]U;M:5FNHV\4G1<AGC_S=M8;HLJPZ6C?2CEEYQ?E69JJLRX8O=0ECG[_024?LHN\V;:;6GAIU]262=NF@^T=>94IOKW[4203@DBXR?:7:KMMQY6>>1BBDZP1658MKOSW82<7D@FT^3:3>OIA]U:M:5FNHV\5G1<AGC_S<M8;HLJPZ7C?2CEEYQ>E69JJLRX9O=0ECG[_324?LHN\V8:;6GAIU]162=NF@^T>>94IOKW[7203@DBXR<:7:KMMQY5>>1BBDZP2658MKOSW;2<7D@FT^0:3>OIA]U9M:5FNHV\6G1<AGC_S?M8;HLJPZ4C?2CEEYQ=E69JJLRX:O=0ECG[_224?LHN\V9:;6GAIU]062=NF@^T?>94IOKW[6203@DBXR=:7:KMMQY4>>1BBDZP3658MKOSW:2<7D@FT^1:3>OIA]U8M:5FNHV\7G1<AGC_S>M8;HLJPZ5C?2CEEYQ<E69JJLRX;O<0ECG[_@48MKOSWK<0@BOKEE58HJANKHFh7@oeosTfvvohfj1Feca}Vdppmjh43G;;?6@>129M575<F8987C?;3:L216=I9?90B<9<;O3;7>H61;1E>>5A2118J7?43G9;?6@<129M775<F:987C=;3:L016=I;?80B9<4N608J=4<F0l0BOQMURRJJZVUGYY<7CK[WNPH6>IL92Z?7]O]T`9SMKYE]ZCOTo5_IO]AQVHFELi0^LCM17]P5ZU6k2XNMIQXIEVK[De<ZLKOSZGKTI]A56=TADUHCABFSHMM[FNBKB<0_B[]CD58WWPFDVK<7^\YAM]A0>UTZH>0_^\M4:VZT@2d3\:$naePmdo\c`hbzh~d~"xnlhf-gvru'{kf`ba[1_-vdk)z&y8Sd`ft/pbi*bwzhg%h}?w1/pbi1e<]9%i`fQbel]dakcui}ey#{ocie,`wqt(zhggcb~T1\,qeh(u'z9Tecg{.scn+avuid$o|<v>.scn0f=R8&hggRcjm^efj`tf|fx$zlbfd/appw)uidfdc}U=]/pbi+t({:Ubbdz!r`o,`utfe'n{=u?!r`o7g>S7'kf`S`kb_fgmawgsg{%}magk.bqwv*tfeeed|V=R.scn*w)t;Vceey }al-gtwgj&mz:t< }al6`?P6(jeaTahcPgdlfvdrhz&|j`dj!crvq+wgjdfe{W9S!r`o-v*u4W`dbx#|nm.fsvdk)ly;s=#|nm5a8Q5)edbUfi`Qheogqeqiu'kgei lsup,vdkkgfzP9P }al,q+v5Xagc"ob/erqeh(cx8r:"ob4b9V4*dkcVgnaRijndpbpjt(~hfbh#m|ts-qehjhgyQ=Q#|nm/p,w6Ynf`~%~lc dqpbi+bw9q;%~lc;c:W3+gjlWdofSjkaescwkw)qieco"n}{r.pbiiihxR=V"ob.s-p7Zoia}$ym`!kpscn*av6p8$ym`o4URGQ[DJNIZi0Y^K]_WKPMGJB;2\HO45YIDU\P\VB;2]NM>5XEC`8SWOSMVLB^^Zl;VPJP@YJGMOTMn5XRHVF[HICMVHo7Z\FTD]TMAROWHn0[_G[E^UJ@QNXJ8n0TDBFNY/[@G&7&8*XXXL/0/3#EVENA?1S_YBFB69[WQY@FMh0TRM@RD]JJCI13QniSDji;Yfk[Utne_oydaa119[`hYJiceyZh||inl24>^ceVGbbb|Yesqjkk><imnym%>&8:cg`wg/9 30mij}a)33-<=flmxj$<?&9:cg`wg/9;#27ljkr`*27,><imnym%<&8:cg`wg/; 20mij}a)6*<>gcl{k#9$64aefqe-0.02koho'7(:8eabui!2"46okdsc+=,><imnym1>19:cg`wg;99427ljkr`>25;?<imnym1?=>c9b`atf4891<374aefqe974611jhi|n<0<;?dbczh69255ndepb868?3hno~l2;>99b`atf4<437ljkr`>5:==flmxj0:07;`fgvd:?611jhi|n<8<;?dbczk";%55ndepa,4/>3hno~o&>0(;8eabuj!;:%45ndepa,44.12kohl'12+;?dbczk"9%55ndepa,6/?3hno~o&;)99b`ate <#37ljkrc*5-==flmxi$:'7;`fgvg.?!11jhi|m(8+a?dbczk6:?7>12b9ahnYjmdUlicQy4^1/$]okagr+OB\J Fgmawgsg{*:>#:;;bnhe1=ddbh<7ilftdpq3>bnfh";%:5kioc+5,1<l`dj$?'8;ekme-5.?2nbbl&;)69gmkg/= =0hd`n(7+4?aoii!="56jfn`>4>5803mcen%>&7:fjjg.6!>1oecl'2(58`lhe :#<7igab)6*3>bnfk">%:5kio`+2,1<l`di$:'6;ekmf91=8720hb{{a)2*<>bh}}k#=$64dnwwe-4.02ndyyo'3(:8`jssi!>"46j`uuc+1,><lfm%8&8:flqqg/? 20hb{{a=2=<>bh}}k7=364dnwwe94902ndyyo33?:8`jssi5>546j`uuc?1;><lfm181a:flqqg;?3:546j`uuc?3;><lfn%>&8:flqqd/9 20hb{{b)0*<>bh}}h#?$64dnwwf-2.02ndyyl'5(:8`jssj!<"46j`uu`+3,><lfn1>1a:flqqd;?3:546kkig0mca5<mgk87h`md:kmn`eslkci|k;hliafrtj`~n~64nfaaqljck2xomij}eba+4,e<zmkohklc)3*`>tcimnyinm'11+g?wbflmxnon&>1(f8vagcl{oho%?=)e9q`dbczlih$<=&c:pgeabumji#>$m4recg`wcdk!9"o6|kaefqafe/< i0~iokdsg`g-3.k2xomij}eba+2,e<zmkohklc)5*g>tcimnyinm'8(a8vagcl{oho%7&f:pgeabumji7=>4?>79qabebi?1yijmjb29qkh7b3{ef obd_lgn[bciW>T?!@@ND.MKKC4mh1yc`"mlj]nahY`mgU}8R=#{b]kevYumninn0>#c^jbwZtbojoj1="l_lgn[qwm49'oR||tscn[g;7$jUyy|nm^c>4)eXzz~Txt~j=R[MG)eX`hyTecdjcugqv86+kVzye`Q{yqg>5)eXagcnRxnl<2/gZtbimU|eizg_c?;(fYumhnT{dj{h^c><)eX}zoTbh{eba>4)eXl`yjnakPw`pm[gnqWjeg`0>#c^kmmqYaaeoTblcj=smn*hoa$jU|~dzj_lmgaZd:_[C_IRHFRRV/gZqua}oTabjj_`?TVLRBWOCY_Y"l_lw{[uowmeceiR}{afgp95*dWakxS~aitda`[jssx|~T~hi|_c?3(fYoizUfi`Q`uurvpZtbozUi1="l_mmb`Zoia}Umeak21-a\lduXelgTcxzuu]qabuXi4:'oRy}iug\``vs`Vh6=;=74-a\swosmVnn|yfPa<357=2+kVbjR||tc?3(fYoizUyyo20-a\mkosiV|j`0>#c^jbwZkrpVe~x}{{_sgdwZd:8%iTdl}Pmtz\kprw}}Uyij}Pa<2/gZgcl{kT{dj{h<37(fYflmxiSzgkti?20)eX`hyTbh{eba\mkvr|Vxnk~Qn=1.`[acai|fSio{a<2/gZstmVoho0>#c^cocjtn|ag6=!mPdhqbficXhxeSofy_scmc`;7$jU|~dzj_vkgpmYe51&hSz|ftd]tmaroWh73 nQ}e`f\``vs`Vh6=;=74-a\f|rbWzcqi07#c^pfeaYcmy~cSl3>62:7(fYtadUhcabfshmm[fnbkb7J@A"l_bmnijhXkea6<!mPwdc\slbs`4;'oRfns^gmf86+kVbjRkaa<3/gZqbjV}bhyf21-aliuiimg~Tblcj=smn(fYr{lUiuykPwd`>4)eX}zoTntzj_vgb95*dW{yS}|foskw}Zd:KL&hS}{_qpjkwosqVk6OH"l_tqf[acai|fSio{a<2/y4g<zfgTnaePmdo\c`hX~=U8Su}{_068vvrf<2xxxo94sckwawta3}g{#Rmh/smn*kah>2}nm%>&8:ufe96=87<0{hl'0(:8s`d;83:5qMN2068DE~4:o0M694>{R3`=?5693926<=<0246>6250<qe>o<51:l1f6<13-8i<7<nc:P5f1=;8;1?44>322020<4<;2>7^<9c;122?6=9:9;?;;5350;1>U6k>08=;4?:01046022:>94;5k33:94?7=9rY:o44<1080=?74;99=97=;2978rQ4>;3:1=7?518yP5f?=;8;1?44>322020<4<;2>7)<n4;05`>P5j809wx<9e;38q70a291v(?6l:`08f64?290:47=519yK6d4<R83o6?u;7;306?{#:021??64$3ce>7c73`9:>7>5;h0a=?6=,;2n6?m9;o0;`?6<3`8i47>5$3:f>7e13g83h7?4;h0a3?6=,;2n6?m9;o0;`?4<3`8i:7>5$3:f>7e13g83h7=4;h0`5?6=,;2n6?m9;o0;`?2<3`8h<7>5$3:f>7e13g83h7;4;h0ab?6=,;2n6?m9;o0;`?0<3`8ii7>5$3:f>7e13g83h794;h0a`?6=,;2n6?m9;o0;`?><3`8io7>5$3:f>7e13g83h774;h0af?6=,;2n6?m9;o0;`?g<3`8im7>5$3:f>7e13g83h7l4;h0a1?6=,;2n6?m9;o0;`?e<3`8i87>5$3:f>7e13g83h7j4;n0e`?6=,;2n6>>:;o0;`?6<3f8mo7>5$3:f>6623g83h7?4;n0ef?6=,;2n6>>:;o0;`?4<3f8mm7>5$3:f>6623g83h7=4;n0e=?6=,;2n6>>:;o0;`?2<3f8m47>5$3:f>6623g83h7;4;n0e3?6=,;2n6>>:;o0;`?0<3f8m:7>5$3:f>6623g83h794;h0f5?6=3k8j?7>51;294~N5i;1/>4652`18k7>e2900qo<=9;295?6=8rB9m?5+28:967?<g;836=44}c3:g?6==1026<7tH3c1?_7>l3;9w9755886e?202=21=><51219566=9:;1844>338276<213?j6995498275<6;80v(?77:20a?!7d<39956*>c9806d=#:121>5o4i236>5<<g:;h6=4+29g9773<f;2o6=54o23a>5<#:1o1??;4n3:g>4=<g:;j6=4+29g9773<f;2o6?54o23:>5<#:1o1??;4n3:g>6=<g:8?6=4+29g9773<f;2o6954o200>5<#:1o1??;4n3:g>0=<g:896=4+29g9773<f;2o6;54o202>5<#:1o1??;4n3:g>2=<g:8;6=4+29g9773<f;2o6554o23e>5<#:1o1??;4n3:g><=<g:;n6=4+29g9773<f;2o6l54o23g>5<#:1o1??;4n3:g>g=<g:;36=4+29g9773<f;2o6n54o234>5<#:1o1??;4n3:g>a=<a:;96=44i230>5<<a:8=6=44i204>5<<a:9;6=4+29g9767<f;2o6=54i211>5<#:1o1?>=4n3:g>5=<a;h26=4+29g96f0<f;2o6=54i3`;>5<#:1o1>n84n3:g>4=<a;h<6=4+29g96f0<f;2o6?54i3`5>5<#:1o1>n84n3:g>6=<a;i:6=4+29g96f0<f;2o6954i3a3>5<#:1o1>n84n3:g>0=<a;hm6=4+29g96f0<f;2o6;54i3`f>5<#:1o1>n84n3:g>2=<a;ho6=4+29g96f0<f;2o6554i3``>5<#:1o1>n84n3:g><=<a;hi6=4+29g96f0<f;2o6l54i3`b>5<#:1o1>n84n3:g>g=<a;h>6=4+29g96f0<f;2o6n54i3`7>5<#:1o1>n84n3:g>a=<a;n=6=4+29g96a`<f;2o6=54i3f6>5<#:1o1>ih4n3:g>4=<a;n?6=4+29g96a`<f;2o6?54i3f0>5<#:1o1>ih4n3:g>6=<a;nn6=4+29g96a`<f;2o6954i3fg>5<#:1o1>ih4n3:g>0=<a;nh6=4+29g96a`<f;2o6;54i3fa>5<#:1o1>ih4n3:g>2=<a;nj6=4+29g96a`<f;2o6554i3f:>5<#:1o1>ih4n3:g><=<a;n36=4+29g96a`<f;2o6l54i3f4>5<#:1o1>ih4n3:g>g=<a;n96=4+29g96a`<f;2o6n54i3f2>5<#:1o1>ih4n3:g>a=<a:8h6=44i20g>5<<g:8n6=44o3dg>5<#:1o1?=;4n3:g>5=<g;lh6=4+29g9753<f;2o6<54o3da>5<#:1o1?=;4n3:g>7=<g;lj6=4+29g9753<f;2o6>54o3d:>5<#:1o1?=;4n3:g>1=<g;l36=4+29g9753<f;2o6854o3d4>5<#:1o1?=;4n3:g>3=<g;l=6=4+29g9753<f;2o6:54o22f>5<#:1o1?<>4n3:g>5=<g::o6=4+29g9746<f;2o6<54o22`>5<#:1o1?<>4n3:g>7=<g::i6=4+29g9746<f;2o6>54o22b>5<#:1o1?<>4n3:g>1=<g::26=4+29g9746<f;2o6854o22;>5<#:1o1?<>4n3:g>3=<g::<6=4+29g9746<f;2o6:54i3g2>5<<a;o96=44i3ga>5<#:1o1>hm4n3:g>5=<a;oj6=4+29g96`e<f;2o6<54i3g:>5<#:1o1>hm4n3:g>7=<a;o36=4+29g96`e<f;2o6>54i3g4>5<#:1o1>hm4n3:g>1=<a;o=6=4+29g96`e<f;2o6854i3g6>5<#:1o1>hm4n3:g>3=<a;o?6=4+29g96`e<f;2o6:54i3d7>5<#:1o1>k;4n3:g>5=<a;l86=4+29g96c3<f;2o6<54i3d1>5<#:1o1>k;4n3:g>7=<a;l:6=4+29g96c3<f;2o6>54i3d3>5<#:1o1>k;4n3:g>1=<a;om6=4+29g96c3<f;2o6854i3gf>5<#:1o1>k;4n3:g>3=<a;oo6=4+29g96c3<f;2o6:54i237>5<<g;o86=44b3cf>5<6290;w)<68;01=>N5im1C>l<4o30;>5<<uk8j<7>52983>5}O:h80(?77:3:e?_7>l3<p884;6;74>0>==k0>o7s+1gg9647<,;8j6<=k;%01f?453-89o7?<c:&16a<e;2.9>h4>2c9'67`=9<h0(?=?:0;7?!4493;9>6*=338ae>"5;:0?h6*=3586a>"5;<08:6*=37825`=#::=19?5+22:93g=#::31?o5+22c971=#::h1?n5+22a910=#::n1:6*=3d827>"5;o0:n45+25297a=#:=;1=?o4$361>4g?3-8??7<l;%070?g<,;>>6<l:;%072?`53-8?;786;%07<?7fl2.9844>049'61g=m01/>9l520;8 72d21;0(?:k:0c2?!43m3h=7)<;f;4`?!4283;jn6*=50855>"5=;0:h6*=52824d=#:<>1n55+24793>"5=?0:m;5+24595f5<,;?36<67;%06=?7502.99l4>109'60d=l81/>8m54:&11a<6io1/>8k5ce9'60`=nh1/>;>5299'637=9k1/>;<52368 7042;8<7)<94;013>"5><09>:5+2749671<,;<<6?5+27:9543<,;<26474$34b>4=#:081=5m4$34a>4=#:0>1=6*=a981e2=#:h31>l94n0g1>5=i9l?1<6`=9182?k4>93;0b?on:09m6dd=92.:jk4=109'6<3=92c:o84?::k2`c<72-83i7?ke:l1<a<732c:jn4?::k22c<72-83i7?9e:l1<a<732c::i4?:%0;a?71m2d94i4>;:k22f<72-83i7?9e:l1<a<532c::o4?:%0;a?71m2d94i4<;:k23=<72-83i7?9e:l1<a<332c:;:4?:%0;a?71m2d94i4:;:k233<72-83i7?9e:l1<a<132c:;84?:%0;a?71m2d94i48;:k231<72-83i7?9e:l1<a<?32c:;>4?:%0;a?71m2d94i46;:k237<72-83i7?9e:l1<a<f32c:;<4?:%0;a?71m2d94i4m;:k235<72-83i7?9e:l1<a<d32c::l4?:%0;a?71m2d94i4k;:m2a4<72-83i7?j0:l1<a<732e:i94?:%0;a?7b;2d94i4?;:k2g3<722c:ji4?::k1=3<722c95:4?::k1e0<722c9m;4?::k23`<72-83i7?8d:l1<a<732c:;n4?:%0;a?70l2d94i4>;:k23g<72-83i7?8d:l1<a<532c:;l4?:%0;a?70l2d94i4<;:k2<2<72-83i7?8d:l1<a<332c:4;4?:%0;a?70l2d94i4:;:k2<0<72-83i7?8d:l1<a<132c:494?:%0;a?70l2d94i48;:k2<6<72-83i7?8d:l1<a<?32c:4?4?:%0;a?70l2d94i46;:k2<4<72-83i7?8d:l1<a<f32c:4=4?:%0;a?70l2d94i4m;:k23c<72-83i7?8d:l1<a<d32c:;44?:%0;a?70l2d94i4k;:k2`a<72-83i7?kc:l1<a<732wi>4h50;0;>5<7sA8j>6*=9981<c=]90n1:v:::54912<203?i68m5}%3ea?4692.9>l4=149'67d=:8o0(?<l:0;1?!45l3;i?6*=2d8a=>"5:o0:5>5+2229513<,;9:6?o4$311>7d<,;986<:9;%000?77?2.9?846d:&173<68o1/>>95529'66>=9920(?=6:718 75f2>o0(?=m:748 75d2<<0(?=k:32g?!44m38:o6*=3g82g4=#:=:1=484$362>44>3-8?>7?mf:&106<?l2.9894=0:&100<e<2.98;48c:&102<>m2.9854>fc9'61?=1j1/>9o5709'61d=:820(?:l:d78 72c2h>0(?:j:0`5?!43n3;n46*=5182e0=#:<;1ho5+24095g6<,;?86<>k;%060?d53-8>97?97:&113<6i>1/>8951b28 73?2>l0(?;6:0ga?!42i3;:<6*=5c8g0>"5=j0>7)<:d;3ba>"5=l0hi6*=5g8f3>"5>90956*=60824>"5>;09>>5+2719671<,;<?6?<8;%051?45?2.9:;4=269'631=9l1/>;6510c8 70>2h<0(?8n:09'6<4=91i0(?8m:09'6<2=92.9m54=a69'6d?=:h=0b<k=:19m5`3=82d95=4>;o0:5?7<f;kj6<5a2``95>"6no09=<5+28795>o6k<0;66g>dg83>!4?m3;oi6`=8e83?>o6nj0;66g>6g83>!4?m3;=i6`=8e83?>o6>m0;6)<7e;35a>h50m0:76g>6b83>!4?m3;=i6`=8e81?>o6>k0;6)<7e;35a>h50m0876g>7983>!4?m3;=i6`=8e87?>o6?>0;6)<7e;35a>h50m0>76g>7783>!4?m3;=i6`=8e85?>o6?<0;6)<7e;35a>h50m0<76g>7583>!4?m3;=i6`=8e8;?>o6?:0;6)<7e;35a>h50m0276g>7383>!4?m3;=i6`=8e8b?>o6?80;6)<7e;35a>h50m0i76g>7183>!4?m3;=i6`=8e8`?>o6>h0;6)<7e;35a>h50m0o76a>e083>!4?m3;n<6`=8e83?>i6m=0;6)<7e;3f7>h50m0;76g>c783>>o6nm0;66g=9783>>o51>0;66g=a483>>o5i?0;66g>7d83>!4?m3;<h6`=8e83?>o6?j0;6)<7e;34`>h50m0:76g>7c83>!4?m3;<h6`=8e81?>o6?h0;6)<7e;34`>h50m0876g>8683>!4?m3;<h6`=8e87?>o60?0;6)<7e;34`>h50m0>76g>8483>!4?m3;<h6`=8e85?>o60=0;6)<7e;34`>h50m0<76g>8283>!4?m3;<h6`=8e8;?>o60;0;6)<7e;34`>h50m0276g>8083>!4?m3;<h6`=8e8b?>o6090;6)<7e;34`>h50m0i76g>7g83>!4?m3;<h6`=8e8`?>o6?00;6)<7e;34`>h50m0o76g>de83>!4?m3;oo6`=8e83?>{e:0o1<7<7:183M4f:2.9554=8g9Y5<b=>r>>69855686<?3e2<i1q)?ie;025>"5:h0:96*=2c80?!45k3;><6*=2e82b5=#:;o1=l74$30e>4>e3-88<7<>;%005?7>92.9??4=089'665=9jh0(?=;:0:g?!44=3oj7)<<6;022>"5;>027)<<8;0e?!4413;j7)<<a;`2?!44j3kh7)<<c;;5?!44l3937)<<e;027>"5;o0h:6*=418143=#:=;19i5+25097`=#:=91=o64$367>24<,;>>69h4$365>a1<,;><6?>;;%07<?003-8?57?j7:&10d<6l=1/>9l5be9'61e=9:l0(?:k:b68 72b28;0(?:i:0;b?!4283i0(?;>:040?!42:32?7)<:3;3`a>"5==0:>;5+2479651<,;?=6oh4$374>43>3-8>47?j6:&11<<4=2.99l4>3d9'60d=9o90(?;l:33g?!42l3;27)<:e;d3?!42n3;hh6*=618g6>"5>80o:6*=638167=#:?91>?94$347>7403-8=97<=7:&123<5:>1/>;95159'63>=9820(?86:06b?!41i3;0(?7=:0:`?!41j3;0(?7;:09'6d>=:h=0(?o6:3c4?k7b:3:0b<k::19m6<6=92d95<4>;o0be?7<f;ki6<5+1gd9647<,;3>6<5f1b794?=n9ml1<7*=8d82``=i:1n1<65f1ga94?=n9?l1<7*=8d822`=i:1n1<65f17f94?"50l0::h5a29f95>=n9?i1<7*=8d822`=i:1n1>65f17`94?"50l0::h5a29f97>=n9>21<7*=8d822`=i:1n1865f16594?"50l0::h5a29f91>=n9><1<7*=8d822`=i:1n1:65f16794?"50l0::h5a29f93>=n9>>1<7*=8d822`=i:1n1465f16194?"50l0::h5a29f9=>=n9>81<7*=8d822`=i:1n1m65f16394?"50l0::h5a29f9f>=n9>:1<7*=8d822`=i:1n1o65f17c94?"50l0::h5a29f9`>=h9l;1<7*=8d82a5=i:1n1<65`1d694?"50l0:i>5a29f94>=n9j<1<75f1gf94?=n:0<1<75f28594?=n:h?1<75f2`494?=n9>o1<7*=8d823a=i:1n1<65f16a94?"50l0:;i5a29f95>=n9>h1<7*=8d823a=i:1n1>65f16c94?"50l0:;i5a29f97>=n91=1<7*=8d823a=i:1n1865f19494?"50l0:;i5a29f91>=n91?1<7*=8d823a=i:1n1:65f19694?"50l0:;i5a29f93>=n9191<7*=8d823a=i:1n1465f19094?"50l0:;i5a29f9=>=n91;1<7*=8d823a=i:1n1m65f19294?"50l0:;i5a29f9f>=n9>l1<7*=8d823a=i:1n1o65f16;94?"50l0:;i5a29f9`>=n9mn1<7*=8d82`f=i:1n1<65rb3;g>5<503:1<vF=a39'6<>=:1l0V<7k:7y71?212<=1954:b;7`>x"6nl09=<5+23c97c=#:;h1=k;4$30`>4203-89h79?;%01a?7f82.9>k4>249'666=9o;0(?=>:428 7552hn0(?=<:b;8 75321?0(?=::5a8 751289?7)<<7;376>"5;10:h85+22;95g4<,;9j6<o<;%00f?7292.9?n467:&17a<6ij1/>>k5429'66`=9<i0(?:?:075?!4393<;7)<;2;31b>"5<:03?6*=4581a>"5<<0<96*=478147=#:==15k5+25:9557<,;>265o4$36b>g3<,;>i6i64$36`>d5<,;>o6k;4$36f>66<,;>m6<<?;%064?7102.99<4;0:&117<6<j1/>8=5d:&111<>i2.998488:&113<6>2.99:4kd:&11=<?02.9944>e89'60g=9:k0(?;m:020?!42k38:m6*=5e803>"5=l09<k5+24d9g7=#:?:1m45+2739gc=#:?81>??4$340>7403-8=87<=7:&120<5:>1/>;852358 70028=0(?87:03a?!4113;>h6*=6`82?!4>:3;3o6*=6c82?!4><3;0(?o7:3c4?!4f138j;6`>e383?k7b=3:0b?7?:09m6<7=92d9ml4>;o0bf?7<,8lm6??>;%0:1?7<a8i>6=44i0fe>5<#:1o1=ik4n3:g>5=<a8lh6=44i04e>5<#:1o1=;k4n3:g>5=<a8<o6=4+29g953c<f;2o6<54i04`>5<#:1o1=;k4n3:g>7=<a8<i6=4+29g953c<f;2o6>54i05;>5<#:1o1=;k4n3:g>1=<a8=<6=4+29g953c<f;2o6854i055>5<#:1o1=;k4n3:g>3=<a8=>6=4+29g953c<f;2o6:54i057>5<#:1o1=;k4n3:g>==<a8=86=4+29g953c<f;2o6454i051>5<#:1o1=;k4n3:g>d=<a8=:6=4+29g953c<f;2o6o54i053>5<#:1o1=;k4n3:g>f=<a8<j6=4+29g953c<f;2o6i54o0g2>5<#:1o1=h>4n3:g>5=<g8o?6=4+29g95`5<f;2o6=54i0a5>5<<a8lo6=44i3;5>5<<a;3<6=44i3c6>5<<a;k=6=44i05f>5<#:1o1=:j4n3:g>5=<a8=h6=4+29g952b<f;2o6<54i05a>5<#:1o1=:j4n3:g>7=<a8=j6=4+29g952b<f;2o6>54i0:4>5<#:1o1=:j4n3:g>1=<a82=6=4+29g952b<f;2o6854i0:6>5<#:1o1=:j4n3:g>3=<a82?6=4+29g952b<f;2o6:54i0:0>5<#:1o1=:j4n3:g>==<a8296=4+29g952b<f;2o6454i0:2>5<#:1o1=:j4n3:g>d=<a82;6=4+29g952b<f;2o6o54i05e>5<#:1o1=:j4n3:g>f=<a8=26=4+29g952b<f;2o6i54i0fg>5<#:1o1=im4n3:g>5=<uk82o7>52983>5}O:h80(?77:3:e?_7>l3<p884;6;74>0>==k0>o7s+1gg9647<,;8j6<ln;%01f?d<,;8h6<6j;%01`?7f<2.9>h4ne:&16c<1=2.9?=4=169'667=:?1/>><51e38 75428n=7)<<4;47?!44=3;h>6*=378144=#::=14;5+22:9534<,;926??;;%00e?c33-88n7?k8:&17f<c;2.9?i49e:&17`<6jk1/>>h515d8 7272=80(?:>:016?!43:38;o6*=428243=#:=>1io5+25795<d<,;>=6<6n;%073?46:2.9854>919'61?=99>0(?:n:618 72e28?j7)<;c;4g?!43l3lh7)<;e;30f>"5<o0:<?5+2429561<,;?:6l94$371>4`?3-8>?7?jc:&111<6n=1/>8;5a19'600=9;=0(?;8:d38 73?2;>0(?;6:0`g?!42i32i7)<:b;31`>"5=j0::85+24f95d4<,;?n6?>n;%06b?`b3-8=<7l8;%055?76l2.9:?4=279'635=:;=0(?8;:304?!41=389;6*=678162=#:?=1o=5+27:9541<,;<26<;j;%05e?7<,;396<6l;%05f?7<,;3?6<5+2`:96d1<,;k26?o8;o3f6?6<f8o>6=5a28295>h5180:7c<na;38j7ge281/=kh52038 7?2281b=n;50;9j5a`=83.94h4>dd9m6=b=821b=km50;9j53`=83.94h4>6d9m6=b=821b=;j50;&1<`<6>l1e>5j51:9j53e=83.94h4>6d9m6=b=:21b=;l50;&1<`<6>l1e>5j53:9j52>=83.94h4>6d9m6=b=<21b=:950;&1<`<6>l1e>5j55:9j520=83.94h4>6d9m6=b=>21b=:;50;&1<`<6>l1e>5j57:9j522=83.94h4>6d9m6=b=021b=:=50;&1<`<6>l1e>5j59:9j524=83.94h4>6d9m6=b=i21b=:?50;&1<`<6>l1e>5j5b:9j526=83.94h4>6d9m6=b=k21b=;o50;&1<`<6>l1e>5j5d:9l5`7=83.94h4>e19m6=b=821d=h:50;&1<`<6m:1e>5j50:9j5f0=831b=kj50;9j6<0=831b>4950;9j6d3=831b>l850;9j52c=83.94h4>7e9m6=b=821b=:m50;&1<`<6?m1e>5j51:9j52d=83.94h4>7e9m6=b=:21b=:o50;&1<`<6?m1e>5j53:9j5=1=83.94h4>7e9m6=b=<21b=5850;&1<`<6?m1e>5j55:9j5=3=83.94h4>7e9m6=b=>21b=5:50;&1<`<6?m1e>5j57:9j5=5=83.94h4>7e9m6=b=021b=5<50;&1<`<6?m1e>5j59:9j5=7=83.94h4>7e9m6=b=i21b=5>50;&1<`<6?m1e>5j5b:9j52`=83.94h4>7e9m6=b=k21b=:750;&1<`<6?m1e>5j5d:9j5ab=83.94h4>db9m6=b=821vn?7m:181<?6=8rB9m?5+28:96=`<R83o6;u;5;65>01==10>n7;l:|&2b`<5981/>?o51408 74e2o=0(?<l:32;?!45l3;nh6*=2d8;3>"5:o09<h5+22295a6<,;9:6<:6;%006?133-88?76?;%000?ef3-889766;%002?4782.9?:4>cb9'66>=:990(?=6:838 75f28:i7)<<b;54?!44k3337)<<d;3:1>"5;l0o96*=3g8:0>"5<908?6*=40820a=#:=81=?k4$360>3d<,;>?64=4$366>4><,;>=69:4$364>46d3-8?47<?b:&10<<an2.98l4;e:&10g<6ko1/>9m5f:&10a<f02.98h4>d29'61`=9?:0(?;?:0f1?!4293;:>6*=538201=#:<91==74$377>=4<,;?>6<89;%062?7bn2.99:4>389'60>=9j1/>875eg9'60g=?01/>8l5a`9'60e=k>1/>8j5ac9'60c=mj1/>8h519d8 7072>n0(?8>:07;?!41:38:j6*=628162=#:?>1>?94$346>7403-8=:7<=7:&122<4:2.9:54>189'63?=98i0(?8n:09'6<4=91i0(?8m:09'6<2=92.9m54=a69'6d?=:h=0b<k=:19m5`3=82d95=4>;o0:5?7<f;kj6<5a2``95>"6no09=<5+28795>o6k<0;66g>dg83>!4?m3;oi6`=8e83?>o6nj0;66g>6g83>!4?m3;=i6`=8e83?>o6>m0;6)<7e;35a>h50m0:76g>6b83>!4?m3;=i6`=8e81?>o6>k0;6)<7e;35a>h50m0876g>7983>!4?m3;=i6`=8e87?>o6?>0;6)<7e;35a>h50m0>76g>7783>!4?m3;=i6`=8e85?>o6?<0;6)<7e;35a>h50m0<76g>7583>!4?m3;=i6`=8e8;?>o6?:0;6)<7e;35a>h50m0276g>7383>!4?m3;=i6`=8e8b?>o6?80;6)<7e;35a>h50m0i76g>7183>!4?m3;=i6`=8e8`?>o6>h0;6)<7e;35a>h50m0o76a>e083>!4?m3;n<6`=8e83?>i6m=0;6)<7e;3f7>h50m0;76g>c783>>o6nm0;66g=9783>>o51>0;66g=a483>>o5i?0;66g>7d83>!4?m3;<h6`=8e83?>o6?j0;6)<7e;34`>h50m0:76g>7c83>!4?m3;<h6`=8e81?>o6?h0;6)<7e;34`>h50m0876g>8683>!4?m3;<h6`=8e87?>o60?0;6)<7e;34`>h50m0>76g>8483>!4?m3;<h6`=8e85?>o60=0;6)<7e;34`>h50m0<76g>8283>!4?m3;<h6`=8e8;?>o60;0;6)<7e;34`>h50m0276g>8083>!4?m3;<h6`=8e8b?>o6090;6)<7e;34`>h50m0i76g>7g83>!4?m3;<h6`=8e8`?>o6?00;6)<7e;34`>h50m0o76g>de83>!4?m3;oo6`=8e83?>{e:0k1<7<7:183M4f:2.9554=8g9Y5<b=>r>>69855686<?3e2<i1q)?ie;025>"5:h0::45+23`9560<,;8h6k?4$30g>1d<,;8n6<j6;%01b?4682.9?=4mb:&174<6<l1/>><5269'665=1<1/>>:51338 7522080(?=9:070?!44?3;m>6*=398210=#::31:l5+22c955c<,;9i6?;4$31`>`b<,;9o6k84$31f>02<,;9m6:84$363>a?<,;>:64>4$361>4`>3-8??7?m1:&101<c82.9884>f69'610=9lk0(?:8:9g8 72?2;n0(?:6:9a8 72f2l90(?:m:5c8 72d2?l0(?:k:g18 72b28??7)<;f;3:b>"5=90h46*=508gg>"5=;0mh6*=5282=`=#:<>1=;?4$376>4743-8>:7m>;%063?263-8>47?=;%06=?1f3-8>m7=n;%06f?3a3-8>o7?94:&11a<b3-8>i7ji;%06b?e23-8=<7?:7:&124<69o1/>;<52328 7042;8<7)<94;013>"5><09>:5+2749671<,;<<6<h4$34;>4713-8=57o:;%05e?7<,;396<6l;%05f?7<,;3?6<5+2`:96d1<,;k26?o8;o3f6?6<f8o>6=5a28295>h5180:7c<na;38j7ge281/=kh52038 7?2281b=n;50;9j5a`=83.94h4>dd9m6=b=821b=km50;9j53`=83.94h4>6d9m6=b=821b=;j50;&1<`<6>l1e>5j51:9j53e=83.94h4>6d9m6=b=:21b=;l50;&1<`<6>l1e>5j53:9j52>=83.94h4>6d9m6=b=<21b=:950;&1<`<6>l1e>5j55:9j520=83.94h4>6d9m6=b=>21b=:;50;&1<`<6>l1e>5j57:9j522=83.94h4>6d9m6=b=021b=:=50;&1<`<6>l1e>5j59:9j524=83.94h4>6d9m6=b=i21b=:?50;&1<`<6>l1e>5j5b:9j526=83.94h4>6d9m6=b=k21b=;o50;&1<`<6>l1e>5j5d:9l5`7=83.94h4>e19m6=b=821d=h:50;&1<`<6m:1e>5j50:9j5f0=831b=kj50;9j6<0=831b>4950;9j6d3=831b>l850;9j52c=83.94h4>7e9m6=b=821b=:m50;&1<`<6?m1e>5j51:9j52d=83.94h4>7e9m6=b=:21b=:o50;&1<`<6?m1e>5j53:9j5=1=83.94h4>7e9m6=b=<21b=5850;&1<`<6?m1e>5j55:9j5=3=83.94h4>7e9m6=b=>21b=5:50;&1<`<6?m1e>5j57:9j5=5=83.94h4>7e9m6=b=021b=5<50;&1<`<6?m1e>5j59:9j5=7=83.94h4>7e9m6=b=i21b=5>50;&1<`<6?m1e>5j5b:9j52`=83.94h4>7e9m6=b=k21b=:750;&1<`<6?m1e>5j5d:9j5ab=83.94h4>db9m6=b=821vn?76:181<?6=8rB9m?5+28:96=`<R83o6;u;5;65>01==10>n7;l:|&2b`<5981/>?o5b19'67d=k:1/>?m51e58 74c2<;0(?<j:0;:?!45n3nj7)<<0;3:3>"5;80:ol5+2209a5=#::91=?=4$317>4673-88978=;%002?7302.9?:4>399'66>=9020(?=6:g`8 75f21l0(?=m:063?!44k3;?n6*=3e8140=#::o1=8h4$31e>4dd3-8?<7h6;%075?75k2.98?4j8:&106<dj2.9894<1:&100<cm2.98;4>bd9'611=::1/>9651e`8 72>2?20(?:n:060?!43j3;m:6*=4b8fa>"5<m0:>95+25g95g1<,;>m6h84$373>==#:<;1nh5+2409gf=#:<915o5+2469b==#:<?1=9?4$375>4gf3-8>;7?m4:&11=<6nh1/>8751dg8 73f2h;0(?;m:d08 73d2;;i7)<:d;``?!42m3km7)<:f;d7?!4183;356*=6082`d=#:?81>?;4$340>7403-8=87<=7:&120<5:>1/>;852358 7002;1/>;651068 70>2030(?8n:09'6<4=91i0(?8m:09'6<2=92.9m54=a69'6d?=:h=0b<k=:19m5`3=82d95=4>;o0:5?7<f;kj6<5a2``95>"6no09=<5+28795>o6k<0;66g>dg83>!4?m3;oi6`=8e83?>o6nj0;66g>6g83>!4?m3;=i6`=8e83?>o6>m0;6)<7e;35a>h50m0:76g>6b83>!4?m3;=i6`=8e81?>o6>k0;6)<7e;35a>h50m0876g>7983>!4?m3;=i6`=8e87?>o6?>0;6)<7e;35a>h50m0>76g>7783>!4?m3;=i6`=8e85?>o6?<0;6)<7e;35a>h50m0<76g>7583>!4?m3;=i6`=8e8;?>o6?:0;6)<7e;35a>h50m0276g>7383>!4?m3;=i6`=8e8b?>o6?80;6)<7e;35a>h50m0i76g>7183>!4?m3;=i6`=8e8`?>o6>h0;6)<7e;35a>h50m0o76a>e083>!4?m3;n<6`=8e83?>i6m=0;6)<7e;3f7>h50m0;76g>c783>>o6nm0;66g=9783>>o51>0;66g=a483>>o5i?0;66g>7d83>!4?m3;<h6`=8e83?>o6?j0;6)<7e;34`>h50m0:76g>7c83>!4?m3;<h6`=8e81?>o6?h0;6)<7e;34`>h50m0876g>8683>!4?m3;<h6`=8e87?>o60?0;6)<7e;34`>h50m0>76g>8483>!4?m3;<h6`=8e85?>o60=0;6)<7e;34`>h50m0<76g>8283>!4?m3;<h6`=8e8;?>o60;0;6)<7e;34`>h50m0276g>8083>!4?m3;<h6`=8e8b?>o6090;6)<7e;34`>h50m0i76g>7g83>!4?m3;<h6`=8e8`?>o6?00;6)<7e;34`>h50m0o76g>de83>!4?m3;oo6`=8e83?>{t;9l1<7m6{_0f7>X4:l1U?<m4^23a?[56i2T8=45Q3368Z6443W99>6P<209]776<V:;m7S=>e:\05a=Y;820R>?8;_13a>X48m1U?=m4^22a?[57i2T8<45Q31:8Z660348ji7<=8:?1e5<6lo16>l>51b4897g728lo70<n0;0:2>;5i9095:522`296d3<5;k;6?o9;<0b4?70m279m=4>7b9>6d6=9>h01?o?:05b?84f83;3;63=a182<3=::h:1=5;4=3c3>4>3348j<7?73:?1e5<60;16>l>5193897g7282;70<n0;34b>;5i90:;4522`295ab<5;3m6<ji;<0:b?7d>2795k4>fe9>6<`=:0<01?7i:3;4?84>n38j963=9g81e3=::0l1=:k4=3;e>41d3482j7?8b:?1=c<6?h16>4h5195897?a282=70<6f;3;1>;51o0:495228d95=5<5;3m6<6=;<0:b?7?92795k4>819>6<`=9>l01?7i:05:?84>n3;oh63=9d82`c=::0o1=n84=3;f>4`c3482i7<66:?1=`<51>16>4k52`7897?b2;k=70<6e;34a>;51l0:;n5228g952d<5;3n6<9n;<0:a?7??2795h4>879>6<c=91?01?7j:0:7?84>m3;3?63=9d82<7=::0o1=5?4=3;f>4>73482i7?8f:?1=`<6?016>4k51ef897?c28nm70<6d;3`2>;51m0:ji5228f96<0<5;3o6?78;<0:`?4f=2795i4=a79>6<b=9>o01?7k:05`?84>l3;<n63=9e823d=::0n1=594=3;g>4>13482h7?75:?1=a<60=16>4j5191897?c282970<6d;3;5>;51m0:4=5228f952`<5;3o6<96;<0:`?7cl2795n4>dg9>6<e=9j<01?7l:0dg?84>k382:63=9b81=2=::0i1>l;4=3;`>7g13482o7?8e:?1=f<6?j16>4m516`897?d28=j70<6c;3;3>;51j0:4;5228a95=3<5;3h6<6;;<0:g?7?;2795n4>839>6<e=91;01?7l:0:3?84>k3;<j63=9b823<=::0i1=ij4=3;a>4ba3482n7?l6:?1=g<6nm16>4l5284897?e2;3<70<6b;0b1>;51k09m;5228`952c<5;3i6<9l;<0:f?70j2795o4>7`9>6<d=91=01?7m:0:5?84>j3;3963=9c82<1=::0h1=5=4=3;a>4>53482n7?71:?1=g<60916>4l516d897?e28=270<6b;3g`>;51h0:hk5228c95f0<5;3j6<hk;<0:e?4>>2795l4=969>6<g=:h?01?7n:3c5?84>i3;<i63=9`823f=::0k1=:l4=3;b>41f3482m7?77:?1=d<60?16>4o5197897?f282?70<6a;3;7>;51h0:4?5228c95=7<5;3j6<6?;<0:e?70n2795l4>789>6<g=9mn01?76:0fe?84>13;h:63=9882ba=::031>484=3;:>7?0348257<n5:?1=<<5i?16>47516g897?>28=h70<69;34f>;5100:;l5228;95=1<5;326<69;<0:=?7?=279544>859>6<?=91901?76:0:1?84>13;3=63=9882<5=::031=:h4=3;:>41>348257?kd:p744=833pR>?=;<0b4?7ak2795k4>fb9>6<c=9oi01?7k:0d`?84>k3;mo63=9c82bf=::0k1=km4=3;:>4`d3ty9i<4?:8y]6`7<5;k;6<m:;<0:b?7d=2795h4>c49>6<b=9j?01?7l:0a6?84>j3;h963=9`82g0=::031=n;4}r132?6=:rT9ji522`295`7<uz9;87>52z\1bf=::0l1=h?4}r137?6=:rT9jo5228g95`7<uz9;>7>52z\1bd=::0n1=h?4}r135?6=:rT9j45228a95`7<uz9;<7>52z\1b==::0h1=h?4}r0eb?6=:rT9j:5228c95`7<uz8mi7>52z\1b3=::031=h?4}r0`3?6=1rT9n4522`2953`<5;3m6<8i;<0:a?71n2795i4>6g9>6<e=9?l01?7m:04e?84>i3;=j63=98822c=z{;i>6=46{_0a<>;5i90::i5228d953b<5;3n6<8k;<0:`?71l2795n4>6e9>6<d=9?n01?7n:04g?84>13;=h6s|2b694??|V;h<70<n0;35g>;51o0::n5228g953e<5;3o6<8l;<0:g?71k2795o4>6b9>6<g=9?i01?76:04`?xu5k:0;64uQ2c4897g728<i70<6f;35f>;51l0::o5228f953d<5;3h6<8m;<0:f?71j2795l4>6c9>6<?=9?h0q~<k0;29=~X5k816>l>516:897?a28=370<6e;34<>;51m0:;55228a952><5;3i6<97;<0:e?700279544>799~w7ea2902wS<l0:?1e5<6?>16>4h5165897?b28=<70<6d;343>;51j0:;:5228`9521<5;3j6<98;<0:=?70?2wx>nk50;;xZ7da348j<7?86:?1=c<6??16>4k5164897?c28==70<6c;342>;51k0:;;5228c9520<5;326<99;|q1ga<720qU>ok4=3c3>4123482j7?85:?1=`<6?<16>4j5167897?d28=>70<6b;341>;51h0:;85228;9523<uz8ho7>59z\1fa=::h:1=::4=3;e>4133482i7?84:?1=a<6?=16>4m5166897?e28=?70<6a;340>;5100:;95rs3aa>5<>sW8io63=a18236=::0l1=:=4=3;f>4143482h7?83:?1=f<6?:16>4l5161897?f28=870<69;347>{t:jk1<77t^3`a?84f83;<>63=9g8237=::0o1=:<4=3;g>4153482o7?82:?1=g<6?;16>4o5160897?>28=97p}=c883><}Y:kk01?o?:052?84>n3;<=63=9d8234=::0n1=:?4=3;`>4163482n7?81:?1=d<6?816>4751638yv4d03:15vP=b49>6d6=9>:01?7i:053?84>m3;<<63=9e8235=::0i1=:>4=3;a>4173482m7?80:?1=<<6?91v?m=:18:[4e<279m=4>6`9>6<`=9?k01?7j:04b?84>l3;=m63=9b822d=::0h1=;o4=3;b>40f348257?9a:~w7c62909wS<j1:?2=f<5m81/>l?526c8yv56:3:1>vP<139>5<e=;880(?o>:3:7?xu5k>0;6?uQ2c;894?d2;h27)<n1;0;1>{t:j?1<7<t^3`;?87>k38i46*=a081<3=z{;i?6=4={_0a3>;61j09n:5+2`396=1<uz8h?7>52z\1f3=:90i1>o84$3c2>7173ty9h=4?:3y]6f7<583h6?m>;%0b5?4092wx>nh50;0xZ7e734;2o7<l0:&1e4<5?;1v?mj:181[4en27:5n4=bg9'6d7=:>90q~<ld;296~X5jl16=4m52cg8 7g62;=?7p}=cb83>7}Y:kn01<7l:3`g?!4f938<96s|2b`94?4|V;hh70?6c;0ag>"5i809;;5rs3ab>5<5sW8in63>9b81fg=#:h;1>:94}r0`=?6=:rT9nl5218a96gg<,;k:6?97;|q1g=<72;qU>o;4=0;`>7d23-8j=7<89:p6f4=838pR?l;;<3:g?4e<2.9m<4=7c9~w6612909wS<id:?2=f<5nm1/>l?526a8yv57<3:1>vP=fb9>5<e=:oi0(?o>:35g?xu48:0;6?uQ2g`894?d2;li7)<n1;04a>{t;981<7<t^3db?87>k38mm6*=a0813c=z{:::6=4={_0e=>;61j09j45+2`396=6<uz9;<7>52z\1b==:90i1>k64$3c2>7>63ty9jk4?:3y]6c1<583h6?h8;%0b5?4?:2wx>kk50;0xZ7`134;2o7<i6:&1e4<50:1vqc?j3;296~N5i;1vb<k;:181M4f:2we=h;50;0xL7g53td:i;4?:3yK6d4<ug;n;7>52zJ1e7=zf8o36=4={I0b6>{i9l31<7<tH3c1?xh6mh0;6?uG2`08yk7bj3:1>vF=a39~j4cd2909wE<n2:m5`b=838pD?o=;|l2a`<72;qC>l<4}o3fb?6=:rB9m?5rn0d3>5<5sA8j>6sa1g394?4|@;k97p`>f383>7}O:h80qc?i3;296~N5i;1vb<h;:181M4f:2we=k;50;0xL7g53td:j;4?:3yK6d4<ug;m;7>52zJ1e7=zf8l36=4={I0b6>{i9o31<7<tH3c1?xh6nh0;6?uG2`08yk7di3:1=vF=a39~yx{GHJq9=94jc8d622gzHIHp<pNOPzCD
/zx_ula/branches/xilinx/spectrum_48k_for_digilent_spartan3_starter_kit_with_ps2_keyboard/tv80_alu.v
0,0 → 1,442
//
// TV80 8-Bit Microprocessor Core
// Based on the VHDL T80 core by Daniel Wallner (jesus@opencores.org)
//
// Copyright (c) 2004 Guy Hutchison (ghutchis@opencores.org)
//
// Permission is hereby granted, free of charge, to any person obtaining a
// copy of this software and associated documentation files (the "Software"),
// to deal in the Software without restriction, including without limitation
// the rights to use, copy, modify, merge, publish, distribute, sublicense,
// and/or sell copies of the Software, and to permit persons to whom the
// Software is furnished to do so, subject to the following conditions:
//
// The above copyright notice and this permission notice shall be included
// in all copies or substantial portions of the Software.
//
// THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND,
// EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF
// MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT.
// IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY
// CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT,
// TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE
// SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
 
module tv80_alu (/*AUTOARG*/
// Outputs
Q, F_Out,
// Inputs
Arith16, Z16, ALU_Op, IR, ISet, BusA, BusB, F_In
);
 
parameter Mode = 0;
parameter Flag_C = 0;
parameter Flag_N = 1;
parameter Flag_P = 2;
parameter Flag_X = 3;
parameter Flag_H = 4;
parameter Flag_Y = 5;
parameter Flag_Z = 6;
parameter Flag_S = 7;
 
input Arith16;
input Z16;
input [3:0] ALU_Op ;
input [5:0] IR;
input [1:0] ISet;
input [7:0] BusA;
input [7:0] BusB;
input [7:0] F_In;
output [7:0] Q;
output [7:0] F_Out;
reg [7:0] Q;
reg [7:0] F_Out;
 
function [4:0] AddSub4;
input [3:0] A;
input [3:0] B;
input Sub;
input Carry_In;
begin
AddSub4 = { 1'b0, A } + { 1'b0, (Sub)?~B:B } + {4'h0,Carry_In};
end
endfunction // AddSub4
function [3:0] AddSub3;
input [2:0] A;
input [2:0] B;
input Sub;
input Carry_In;
begin
AddSub3 = { 1'b0, A } + { 1'b0, (Sub)?~B:B } + {3'h0,Carry_In};
end
endfunction // AddSub4
 
function [1:0] AddSub1;
input A;
input B;
input Sub;
input Carry_In;
begin
AddSub1 = { 1'b0, A } + { 1'b0, (Sub)?~B:B } + {1'h0,Carry_In};
end
endfunction // AddSub4
 
// AddSub variables (temporary signals)
reg UseCarry;
reg Carry7_v;
reg OverFlow_v;
reg HalfCarry_v;
reg Carry_v;
reg [7:0] Q_v;
 
reg [7:0] BitMask;
 
 
always @(/*AUTOSENSE*/ALU_Op or BusA or BusB or F_In or IR)
begin
case (IR[5:3])
3'b000 : BitMask = 8'b00000001;
3'b001 : BitMask = 8'b00000010;
3'b010 : BitMask = 8'b00000100;
3'b011 : BitMask = 8'b00001000;
3'b100 : BitMask = 8'b00010000;
3'b101 : BitMask = 8'b00100000;
3'b110 : BitMask = 8'b01000000;
default: BitMask = 8'b10000000;
endcase // case(IR[5:3])
UseCarry = ~ ALU_Op[2] && ALU_Op[0];
{ HalfCarry_v, Q_v[3:0] } = AddSub4(BusA[3:0], BusB[3:0], ALU_Op[1], ALU_Op[1] ^ (UseCarry && F_In[Flag_C]) );
{ Carry7_v, Q_v[6:4] } = AddSub3(BusA[6:4], BusB[6:4], ALU_Op[1], HalfCarry_v);
{ Carry_v, Q_v[7] } = AddSub1(BusA[7], BusB[7], ALU_Op[1], Carry7_v);
OverFlow_v = Carry_v ^ Carry7_v;
end // always @ *
reg [7:0] Q_t;
reg [8:0] DAA_Q;
always @ (/*AUTOSENSE*/ALU_Op or Arith16 or BitMask or BusA or BusB
or Carry_v or F_In or HalfCarry_v or IR or ISet
or OverFlow_v or Q_v or Z16)
begin
Q_t = 8'hxx;
DAA_Q = {9{1'bx}};
F_Out = F_In;
case (ALU_Op)
4'b0000, 4'b0001, 4'b0010, 4'b0011, 4'b0100, 4'b0101, 4'b0110, 4'b0111 :
begin
F_Out[Flag_N] = 1'b0;
F_Out[Flag_C] = 1'b0;
case (ALU_Op[2:0])
3'b000, 3'b001 : // ADD, ADC
begin
Q_t = Q_v;
F_Out[Flag_C] = Carry_v;
F_Out[Flag_H] = HalfCarry_v;
F_Out[Flag_P] = OverFlow_v;
end
3'b010, 3'b011, 3'b111 : // SUB, SBC, CP
begin
Q_t = Q_v;
F_Out[Flag_N] = 1'b1;
F_Out[Flag_C] = ~ Carry_v;
F_Out[Flag_H] = ~ HalfCarry_v;
F_Out[Flag_P] = OverFlow_v;
end
3'b100 : // AND
begin
Q_t[7:0] = BusA & BusB;
F_Out[Flag_H] = 1'b1;
end
3'b101 : // XOR
begin
Q_t[7:0] = BusA ^ BusB;
F_Out[Flag_H] = 1'b0;
end
default : // OR 3'b110
begin
Q_t[7:0] = BusA | BusB;
F_Out[Flag_H] = 1'b0;
end
endcase // case(ALU_OP[2:0])
if (ALU_Op[2:0] == 3'b111 )
begin // CP
F_Out[Flag_X] = BusB[3];
F_Out[Flag_Y] = BusB[5];
end
else
begin
F_Out[Flag_X] = Q_t[3];
F_Out[Flag_Y] = Q_t[5];
end
if (Q_t[7:0] == 8'b00000000 )
begin
F_Out[Flag_Z] = 1'b1;
if (Z16 == 1'b1 )
begin
F_Out[Flag_Z] = F_In[Flag_Z]; // 16 bit ADC,SBC
end
end
else
begin
F_Out[Flag_Z] = 1'b0;
end // else: !if(Q_t[7:0] == 8'b00000000 )
F_Out[Flag_S] = Q_t[7];
case (ALU_Op[2:0])
3'b000, 3'b001, 3'b010, 3'b011, 3'b111 : // ADD, ADC, SUB, SBC, CP
;
default :
F_Out[Flag_P] = ~(^Q_t);
endcase // case(ALU_Op[2:0])
if (Arith16 == 1'b1 )
begin
F_Out[Flag_S] = F_In[Flag_S];
F_Out[Flag_Z] = F_In[Flag_Z];
F_Out[Flag_P] = F_In[Flag_P];
end
end // case: 4'b0000, 4'b0001, 4'b0010, 4'b0011, 4'b0100, 4'b0101, 4'b0110, 4'b0111
4'b1100 :
begin
// DAA
F_Out[Flag_H] = F_In[Flag_H];
F_Out[Flag_C] = F_In[Flag_C];
DAA_Q[7:0] = BusA;
DAA_Q[8] = 1'b0;
if (F_In[Flag_N] == 1'b0 )
begin
// After addition
// Alow > 9 || H == 1
if (DAA_Q[3:0] > 9 || F_In[Flag_H] == 1'b1 )
begin
if ((DAA_Q[3:0] > 9) )
begin
F_Out[Flag_H] = 1'b1;
end
else
begin
F_Out[Flag_H] = 1'b0;
end
DAA_Q = DAA_Q + 6;
end // if (DAA_Q[3:0] > 9 || F_In[Flag_H] == 1'b1 )
// new Ahigh > 9 || C == 1
if (DAA_Q[8:4] > 9 || F_In[Flag_C] == 1'b1 )
begin
DAA_Q = DAA_Q + 96; // 0x60
end
end
else
begin
// After subtraction
if (DAA_Q[3:0] > 9 || F_In[Flag_H] == 1'b1 )
begin
if (DAA_Q[3:0] > 5 )
begin
F_Out[Flag_H] = 1'b0;
end
DAA_Q[7:0] = DAA_Q[7:0] - 6;
end
if (BusA > 153 || F_In[Flag_C] == 1'b1 )
begin
DAA_Q = DAA_Q - 352; // 0x160
end
end // else: !if(F_In[Flag_N] == 1'b0 )
F_Out[Flag_X] = DAA_Q[3];
F_Out[Flag_Y] = DAA_Q[5];
F_Out[Flag_C] = F_In[Flag_C] || DAA_Q[8];
Q_t = DAA_Q[7:0];
if (DAA_Q[7:0] == 8'b00000000 )
begin
F_Out[Flag_Z] = 1'b1;
end
else
begin
F_Out[Flag_Z] = 1'b0;
end
F_Out[Flag_S] = DAA_Q[7];
F_Out[Flag_P] = ~ (^DAA_Q);
end // case: 4'b1100
4'b1101, 4'b1110 :
begin
// RLD, RRD
Q_t[7:4] = BusA[7:4];
if (ALU_Op[0] == 1'b1 )
begin
Q_t[3:0] = BusB[7:4];
end
else
begin
Q_t[3:0] = BusB[3:0];
end
F_Out[Flag_H] = 1'b0;
F_Out[Flag_N] = 1'b0;
F_Out[Flag_X] = Q_t[3];
F_Out[Flag_Y] = Q_t[5];
if (Q_t[7:0] == 8'b00000000 )
begin
F_Out[Flag_Z] = 1'b1;
end
else
begin
F_Out[Flag_Z] = 1'b0;
end
F_Out[Flag_S] = Q_t[7];
F_Out[Flag_P] = ~(^Q_t);
end // case: when 4'b1101, 4'b1110
4'b1001 :
begin
// BIT
Q_t[7:0] = BusB & BitMask;
F_Out[Flag_S] = Q_t[7];
if (Q_t[7:0] == 8'b00000000 )
begin
F_Out[Flag_Z] = 1'b1;
F_Out[Flag_P] = 1'b1;
end
else
begin
F_Out[Flag_Z] = 1'b0;
F_Out[Flag_P] = 1'b0;
end
F_Out[Flag_H] = 1'b1;
F_Out[Flag_N] = 1'b0;
F_Out[Flag_X] = 1'b0;
F_Out[Flag_Y] = 1'b0;
if (IR[2:0] != 3'b110 )
begin
F_Out[Flag_X] = BusB[3];
F_Out[Flag_Y] = BusB[5];
end
end // case: when 4'b1001
4'b1010 :
// SET
Q_t[7:0] = BusB | BitMask;
4'b1011 :
// RES
Q_t[7:0] = BusB & ~ BitMask;
4'b1000 :
begin
// ROT
case (IR[5:3])
3'b000 : // RLC
begin
Q_t[7:1] = BusA[6:0];
Q_t[0] = BusA[7];
F_Out[Flag_C] = BusA[7];
end
3'b010 : // RL
begin
Q_t[7:1] = BusA[6:0];
Q_t[0] = F_In[Flag_C];
F_Out[Flag_C] = BusA[7];
end
3'b001 : // RRC
begin
Q_t[6:0] = BusA[7:1];
Q_t[7] = BusA[0];
F_Out[Flag_C] = BusA[0];
end
3'b011 : // RR
begin
Q_t[6:0] = BusA[7:1];
Q_t[7] = F_In[Flag_C];
F_Out[Flag_C] = BusA[0];
end
3'b100 : // SLA
begin
Q_t[7:1] = BusA[6:0];
Q_t[0] = 1'b0;
F_Out[Flag_C] = BusA[7];
end
3'b110 : // SLL (Undocumented) / SWAP
begin
if (Mode == 3 )
begin
Q_t[7:4] = BusA[3:0];
Q_t[3:0] = BusA[7:4];
F_Out[Flag_C] = 1'b0;
end
else
begin
Q_t[7:1] = BusA[6:0];
Q_t[0] = 1'b1;
F_Out[Flag_C] = BusA[7];
end // else: !if(Mode == 3 )
end // case: 3'b110
3'b101 : // SRA
begin
Q_t[6:0] = BusA[7:1];
Q_t[7] = BusA[7];
F_Out[Flag_C] = BusA[0];
end
default : // SRL
begin
Q_t[6:0] = BusA[7:1];
Q_t[7] = 1'b0;
F_Out[Flag_C] = BusA[0];
end
endcase // case(IR[5:3])
F_Out[Flag_H] = 1'b0;
F_Out[Flag_N] = 1'b0;
F_Out[Flag_X] = Q_t[3];
F_Out[Flag_Y] = Q_t[5];
F_Out[Flag_S] = Q_t[7];
if (Q_t[7:0] == 8'b00000000 )
begin
F_Out[Flag_Z] = 1'b1;
end
else
begin
F_Out[Flag_Z] = 1'b0;
end
F_Out[Flag_P] = ~(^Q_t);
 
if (ISet == 2'b00 )
begin
F_Out[Flag_P] = F_In[Flag_P];
F_Out[Flag_S] = F_In[Flag_S];
F_Out[Flag_Z] = F_In[Flag_Z];
end
end // case: 4'b1000
default :
;
endcase // case(ALU_Op)
Q = Q_t;
end // always @ (Arith16, ALU_OP, F_In, BusA, BusB, IR, Q_v, Carry_v, HalfCarry_v, OverFlow_v, BitMask, ISet, Z16)
endmodule // T80_ALU
/zx_ula/branches/xilinx/spectrum_48k_for_digilent_spartan3_starter_kit_with_ps2_keyboard/rom.mif
0,0 → 1,16384
11110011
10101111
00010001
11111111
11111111
11000011
11001011
00010001
00101010
01011101
01011100
00100010
01011111
01011100
00011000
01000011
11000011
11110010
00010101
11111111
11111111
11111111
11111111
11111111
00101010
01011101
01011100
01111110
11001101
01111101
00000000
11010000
11001101
01110100
00000000
00011000
11110111
11111111
11111111
11111111
11000011
01011011
00110011
11111111
11111111
11111111
11111111
11111111
11000101
00101010
01100001
01011100
11100101
11000011
10011110
00010110
11110101
11100101
00101010
01111000
01011100
00100011
00100010
01111000
01011100
01111100
10110101
00100000
00000011
11111101
00110100
01000000
11000101
11010101
11001101
10111111
00000010
11010001
11000001
11100001
11110001
11111011
11001001
11100001
01101110
11111101
01110101
00000000
11101101
01111011
00111101
01011100
11000011
11000101
00010110
11111111
11111111
11111111
11111111
11111111
11111111
11111111
11110101
11100101
00101010
10110000
01011100
01111100
10110101
00100000
00000001
11101001
11100001
11110001
11101101
01000101
00101010
01011101
01011100
00100011
00100010
01011101
01011100
01111110
11001001
11111110
00100001
11010000
11111110
00001101
11001000
11111110
00010000
11011000
11111110
00011000
00111111
11011000
00100011
11111110
00010110
00111000
00000001
00100011
00110111
00100010
01011101
01011100
11001001
10111111
01010010
01001110
11000100
01001001
01001110
01001011
01000101
01011001
10100100
01010000
11001001
01000110
11001110
01010000
01001111
01001001
01001110
11010100
01010011
01000011
01010010
01000101
01000101
01001110
10100100
01000001
01010100
01010100
11010010
01000001
11010100
01010100
01000001
11000010
01010110
01000001
01001100
10100100
01000011
01001111
01000100
11000101
01010110
01000001
11001100
01001100
01000101
11001110
01010011
01001001
11001110
01000011
01001111
11010011
01010100
01000001
11001110
01000001
01010011
11001110
01000001
01000011
11010011
01000001
01010100
11001110
01001100
11001110
01000101
01011000
11010000
01001001
01001110
11010100
01010011
01010001
11010010
01010011
01000111
11001110
01000001
01000010
11010011
01010000
01000101
01000101
11001011
01001001
11001110
01010101
01010011
11010010
01010011
01010100
01010010
10100100
01000011
01001000
01010010
10100100
01001110
01001111
11010100
01000010
01001001
11001110
01001111
11010010
01000001
01001110
11000100
00111100
10111101
00111110
10111101
00111100
10111110
01001100
01001001
01001110
11000101
01010100
01001000
01000101
11001110
01010100
11001111
01010011
01010100
01000101
11010000
01000100
01000101
01000110
00100000
01000110
11001110
01000011
01000001
11010100
01000110
01001111
01010010
01001101
01000001
11010100
01001101
01001111
01010110
11000101
01000101
01010010
01000001
01010011
11000101
01001111
01010000
01000101
01001110
00100000
10100011
01000011
01001100
01001111
01010011
01000101
00100000
10100011
01001101
01000101
01010010
01000111
11000101
01010110
01000101
01010010
01001001
01000110
11011001
01000010
01000101
01000101
11010000
01000011
01001001
01010010
01000011
01001100
11000101
01001001
01001110
11001011
01010000
01000001
01010000
01000101
11010010
01000110
01001100
01000001
01010011
11001000
01000010
01010010
01001001
01000111
01001000
11010100
01001001
01001110
01010110
01000101
01010010
01010011
11000101
01001111
01010110
01000101
11010010
01001111
01010101
11010100
01001100
01010000
01010010
01001001
01001110
11010100
01001100
01001100
01001001
01010011
11010100
01010011
01010100
01001111
11010000
01010010
01000101
01000001
11000100
01000100
01000001
01010100
11000001
01010010
01000101
01010011
01010100
01001111
01010010
11000101
01001110
01000101
11010111
01000010
01001111
01010010
01000100
01000101
11010010
01000011
01001111
01001110
01010100
01001001
01001110
01010101
11000101
01000100
01001001
11001101
01010010
01000101
11001101
01000110
01001111
11010010
01000111
01001111
00100000
01010100
11001111
01000111
01001111
00100000
01010011
01010101
11000010
01001001
01001110
01010000
01010101
11010100
01001100
01001111
01000001
11000100
01001100
01001001
01010011
11010100
01001100
01000101
11010100
01010000
01000001
01010101
01010011
11000101
01001110
01000101
01011000
11010100
01010000
01001111
01001011
11000101
01010000
01010010
01001001
01001110
11010100
01010000
01001100
01001111
11010100
01010010
01010101
11001110
01010011
01000001
01010110
11000101
01010010
01000001
01001110
01000100
01001111
01001101
01001001
01011010
11000101
01001001
11000110
01000011
01001100
11010011
01000100
01010010
01000001
11010111
01000011
01001100
01000101
01000001
11010010
01010010
01000101
01010100
01010101
01010010
11001110
01000011
01001111
01010000
11011001
01000010
01001000
01011001
00110110
00110101
01010100
01000111
01010110
01001110
01001010
01010101
00110111
00110100
01010010
01000110
01000011
01001101
01001011
01001001
00111000
00110011
01000101
01000100
01011000
00001110
01001100
01001111
00111001
00110010
01010111
01010011
01011010
00100000
00001101
01010000
00110000
00110001
01010001
01000001
11100011
11000100
11100000
11100100
10110100
10111100
10111101
10111011
10101111
10110000
10110001
11000000
10100111
10100110
10111110
10101101
10110010
10111010
11100101
10100101
11000010
11100001
10110011
10111001
11000001
10111000
01111110
11011100
11011010
01011100
10110111
01111011
01111101
11011000
10111111
10101110
10101010
10101011
11011101
11011110
11011111
01111111
10110101
11010110
01111100
11010101
01011101
11011011
10110110
11011001
01011011
11010111
00001100
00000111
00000110
00000100
00000101
00001000
00001010
00001011
00001001
00001111
11100010
00101010
00111111
11001101
11001000
11001100
11001011
01011110
10101100
00101101
00101011
00111101
00101110
00101100
00111011
00100010
11000111
00111100
11000011
00111110
11000101
00101111
11001001
01100000
11000110
00111010
11010000
11001110
10101000
11001010
11010011
11010100
11010001
11010010
10101001
11001111
00101110
00101111
00010001
11111111
11111111
00000001
11111110
11111110
11101101
01111000
00101111
11100110
00011111
00101000
00001110
01100111
01111101
00010100
11000000
11010110
00001000
11001011
00111100
00110000
11111010
01010011
01011111
00100000
11110100
00101101
11001011
00000000
00111000
11100110
01111010
00111100
11001000
11111110
00101000
11001000
11111110
00011001
11001000
01111011
01011010
01010111
11111110
00011000
11001001
11001101
10001110
00000010
11000000
00100001
00000000
01011100
11001011
01111110
00100000
00000111
00100011
00110101
00101011
00100000
00000010
00110110
11111111
01111101
00100001
00000100
01011100
10111101
00100000
11101110
11001101
00011110
00000011
11010000
00100001
00000000
01011100
10111110
00101000
00101110
11101011
00100001
00000100
01011100
10111110
00101000
00100111
11001011
01111110
00100000
00000100
11101011
11001011
01111110
11001000
01011111
01110111
00100011
00110110
00000101
00100011
00111010
00001001
01011100
01110111
00100011
11111101
01001110
00000111
11111101
01010110
00000001
11100101
11001101
00110011
00000011
11100001
01110111
00110010
00001000
01011100
11111101
11001011
00000001
11101110
11001001
00100011
00110110
00000101
00100011
00110101
11000000
00111010
00001010
01011100
01110111
00100011
01111110
00011000
11101010
01000010
00010110
00000000
01111011
11111110
00100111
11010000
11111110
00011000
00100000
00000011
11001011
01111000
11000000
00100001
00000101
00000010
00011001
01111110
00110111
11001001
01111011
11111110
00111010
00111000
00101111
00001101
11111010
01001111
00000011
00101000
00000011
11000110
01001111
11001001
00100001
11101011
00000001
00000100
00101000
00000011
00100001
00000101
00000010
00010110
00000000
00011001
01111110
11001001
00100001
00101001
00000010
11001011
01000000
00101000
11110100
11001011
01011010
00101000
00001010
11111101
11001011
00110000
01011110
11000000
00000100
11000000
11000110
00100000
11001001
11000110
10100101
11001001
11111110
00110000
11011000
00001101
11111010
10011101
00000011
00100000
00011001
00100001
01010100
00000010
11001011
01101000
00101000
11010011
11111110
00111000
00110000
00000111
11010110
00100000
00000100
11001000
11000110
00001000
11001001
11010110
00110110
00000100
11001000
11000110
11111110
11001001
00100001
00110000
00000010
11111110
00111001
00101000
10111010
11111110
00110000
00101000
10110110
11100110
00000111
11000110
10000000
00000100
11001000
11101110
00001111
11001001
00000100
11001000
11001011
01101000
00100001
00110000
00000010
00100000
10100100
11010110
00010000
11111110
00100010
00101000
00000110
11111110
00100000
11000000
00111110
01011111
11001001
00111110
01000000
11001001
11110011
01111101
11001011
00111101
11001011
00111101
00101111
11100110
00000011
01001111
00000110
00000000
11011101
00100001
11010001
00000011
11011101
00001001
00111010
01001000
01011100
11100110
00111000
00001111
00001111
00001111
11110110
00001000
00000000
00000000
00000000
00000100
00001100
00001101
00100000
11111101
00001110
00111111
00000101
11000010
11010110
00000011
11101110
00010000
11010011
11111110
01000100
01001111
11001011
01100111
00100000
00001001
01111010
10110011
00101000
00001001
01111001
01001101
00011011
11011101
11101001
01001101
00001100
11011101
11101001
11111011
11001001
11101111
00110001
00100111
11000000
00000011
00110100
11101100
01101100
10011000
00011111
11110101
00000100
10100001
00001111
00111000
00100001
10010010
01011100
01111110
10100111
00100000
01011110
00100011
01001110
00100011
01000110
01111000
00010111
10011111
10111001
00100000
01010100
00100011
10111110
00100000
01010000
01111000
11000110
00111100
11110010
00100101
00000100
11100010
01101100
00000100
00000110
11111010
00000100
11010110
00001100
00110000
11111011
11000110
00001100
11000101
00100001
01101110
00000100
11001101
00000110
00110100
11001101
10110100
00110011
11101111
00000100
00111000
11110001
10000110
01110111
11101111
11000000
00000010
00110001
00111000
11001101
10010100
00011110
11111110
00001011
00110000
00100010
11101111
11100000
00000100
11100000
00110100
10000000
01000011
01010101
10011111
10000000
00000001
00000101
00110100
00110101
01110001
00000011
00111000
11001101
10011001
00011110
11000101
11001101
10011001
00011110
11100001
01010000
01011001
01111010
10110011
11001000
00011011
11000011
10110101
00000011
11001111
00001010
10001001
00000010
11010000
00010010
10000110
10001001
00001010
10010111
01100000
01110101
10001001
00010010
11010101
00010111
00011111
10001001
00011011
10010000
01000001
00000010
10001001
00100100
11010000
01010011
11001010
10001001
00101110
10011101
00110110
10110001
10001001
00111000
11111111
01001001
00111110
10001001
01000011
11111111
01101010
01110011
10001001
01001111
10100111
00000000
01010100
10001001
01011100
00000000
00000000
00000000
10001001
01101001
00010100
11110110
00100100
10001001
01110110
11110001
00010000
00000101
11001101
11111011
00100100
00111010
00111011
01011100
10000111
11111010
10001010
00011100
11100001
11010000
11100101
11001101
11110001
00101011
01100010
01101011
00001101
11111000
00001001
11001011
11111110
11001001
00100001
00111111
00000101
11100101
00100001
10000000
00011111
11001011
01111111
00101000
00000011
00100001
10011000
00001100
00001000
00010011
11011101
00101011
11110011
00111110
00000010
01000111
00010000
11111110
11010011
11111110
11101110
00001111
00000110
10100100
00101101
00100000
11110101
00000101
00100101
11110010
11011000
00000100
00000110
00101111
00010000
11111110
11010011
11111110
00111110
00001101
00000110
00110111
00010000
11111110
11010011
11111110
00000001
00001110
00111011
00001000
01101111
11000011
00000111
00000101
01111010
10110011
00101000
00001100
11011101
01101110
00000000
01111100
10101101
01100111
00111110
00000001
00110111
11000011
00100101
00000101
01101100
00011000
11110100
01111001
11001011
01111000
00010000
11111110
00110000
00000100
00000110
01000010
00010000
11111110
11010011
11111110
00000110
00111110
00100000
11101111
00000101
10101111
00111100
11001011
00010101
11000010
00010100
00000101
00011011
11011101
00100011
00000110
00110001
00111110
01111111
11011011
11111110
00011111
11010000
01111010
00111100
11000010
11111110
00000100
00000110
00111011
00010000
11111110
11001001
11110101
00111010
01001000
01011100
11100110
00111000
00001111
00001111
00001111
11010011
11111110
00111110
01111111
11011011
11111110
00011111
11111011
00111000
00000010
11001111
00001100
11110001
11001001
00010100
00001000
00010101
11110011
00111110
00001111
11010011
11111110
00100001
00111111
00000101
11100101
11011011
11111110
00011111
11100110
00100000
11110110
00000010
01001111
10111111
11000000
11001101
11100111
00000101
00110000
11111010
00100001
00010101
00000100
00010000
11111110
00101011
01111100
10110101
00100000
11111001
11001101
11100011
00000101
00110000
11101011
00000110
10011100
11001101
11100011
00000101
00110000
11100100
00111110
11000110
10111000
00110000
11100000
00100100
00100000
11110001
00000110
11001001
11001101
11100111
00000101
00110000
11010101
01111000
11111110
11010100
00110000
11110100
11001101
11100111
00000101
11010000
01111001
11101110
00000011
01001111
00100110
00000000
00000110
10110000
00011000
00011111
00001000
00100000
00000111
00110000
00001111
11011101
01110101
00000000
00011000
00001111
11001011
00010001
10101101
11000000
01111001
00011111
01001111
00010011
00011000
00000111
11011101
01111110
00000000
10101101
11000000
11011101
00100011
00011011
00001000
00000110
10110010
00101110
00000001
11001101
11100011
00000101
11010000
00111110
11001011
10111000
11001011
00010101
00000110
10110000
11010010
11001010
00000101
01111100
10101101
01100111
01111010
10110011
00100000
11001010
01111100
11111110
00000001
11001001
11001101
11100111
00000101
11010000
00111110
00010110
00111101
00100000
11111101
10100111
00000100
11001000
00111110
01111111
11011011
11111110
00011111
11010000
10101001
11100110
00100000
00101000
11110011
01111001
00101111
01001111
11100110
00000111
11110110
00001000
11010011
11111110
00110111
11001001
11110001
00111010
01110100
01011100
11010110
11100000
00110010
01110100
01011100
11001101
10001100
00011100
11001101
00110000
00100101
00101000
00111100
00000001
00010001
00000000
00111010
01110100
01011100
10100111
00101000
00000010
00001110
00100010
11110111
11010101
11011101
11100001
00000110
00001011
00111110
00100000
00010010
00010011
00010000
11111100
11011101
00110110
00000001
11111111
11001101
11110001
00101011
00100001
11110110
11111111
00001011
00001001
00000011
00110000
00001111
00111010
01110100
01011100
10100111
00100000
00000010
11001111
00001110
01111000
10110001
00101000
00001010
00000001
00001010
00000000
11011101
11100101
11100001
00100011
11101011
11101101
10110000
11011111
11111110
11100100
00100000
01001001
00111010
01110100
01011100
11111110
00000011
11001010
10001010
00011100
11100111
11001101
10110010
00101000
11001011
11111001
00110000
00001011
00100001
00000000
00000000
00111010
01110100
01011100
00111101
00101000
00010101
11001111
00000001
11000010
10001010
00011100
11001101
00110000
00100101
00101000
00011000
00100011
01111110
11011101
01110111
00001011
00100011
01111110
11011101
01110111
00001100
00100011
11011101
01110001
00001110
00111110
00000001
11001011
01110001
00101000
00000001
00111100
11011101
01110111
00000000
11101011
11100111
11111110
00101001
00100000
11011010
11100111
11001101
11101110
00011011
11101011
11000011
01011010
00000111
11111110
10101010
00100000
00011111
00111010
01110100
01011100
11111110
00000011
11001010
10001010
00011100
11100111
11001101
11101110
00011011
11011101
00110110
00001011
00000000
11011101
00110110
00001100
00011011
00100001
00000000
01000000
11011101
01110101
00001101
11011101
01110100
00001110
00011000
01001101
11111110
10101111
00100000
01001111
00111010
01110100
01011100
11111110
00000011
11001010
10001010
00011100
11100111
11001101
01001000
00100000
00100000
00001100
00111010
01110100
01011100
10100111
11001010
10001010
00011100
11001101
11100110
00011100
00011000
00001111
11001101
10000010
00011100
11011111
11111110
00101100
00101000
00001100
00111010
01110100
01011100
10100111
11001010
10001010
00011100
11001101
11100110
00011100
00011000
00000100
11100111
11001101
10000010
00011100
11001101
11101110
00011011
11001101
10011001
00011110
11011101
01110001
00001011
11011101
01110000
00001100
11001101
10011001
00011110
11011101
01110001
00001101
11011101
01110000
00001110
01100000
01101001
11011101
00110110
00000000
00000011
00011000
01000100
11111110
11001010
00101000
00001001
11001101
11101110
00011011
11011101
00110110
00001110
10000000
00011000
00010111
00111010
01110100
01011100
10100111
11000010
10001010
00011100
11100111
11001101
10000010
00011100
11001101
11101110
00011011
11001101
10011001
00011110
11011101
01110001
00001101
11011101
01110000
00001110
11011101
00110110
00000000
00000000
00101010
01011001
01011100
11101101
01011011
01010011
01011100
00110111
11101101
01010010
11011101
01110101
00001011
11011101
01110100
00001100
00101010
01001011
01011100
11101101
01010010
11011101
01110101
00001111
11011101
01110100
00010000
11101011
00111010
01110100
01011100
10100111
11001010
01110000
00001001
11100101
00000001
00010001
00000000
11011101
00001001
11011101
11100101
00010001
00010001
00000000
10101111
00110111
11001101
01010110
00000101
11011101
11100001
00110000
11110010
00111110
11111110
11001101
00000001
00010110
11111101
00110110
01010010
00000011
00001110
10000000
11011101
01111110
00000000
11011101
10111110
11101111
00100000
00000010
00001110
11110110
11111110
00000100
00110000
11011001
00010001
11000000
00001001
11000101
11001101
00001010
00001100
11000001
11011101
11100101
11010001
00100001
11110000
11111111
00011001
00000110
00001010
01111110
00111100
00100000
00000011
01111001
10000000
01001111
00010011
00011010
10111110
00100011
00100000
00000001
00001100
11010111
00010000
11110110
11001011
01111001
00100000
10110011
00111110
00001101
11010111
11100001
11011101
01111110
00000000
11111110
00000011
00101000
00001100
00111010
01110100
01011100
00111101
11001010
00001000
00001000
11111110
00000010
11001010
10110110
00001000
11100101
11011101
01101110
11111010
11011101
01100110
11111011
11011101
01011110
00001011
11011101
01010110
00001100
01111100
10110101
00101000
00001101
11101101
01010010
00111000
00100110
00101000
00000111
11011101
01111110
00000000
11111110
00000011
00100000
00011101
11100001
01111100
10110101
00100000
00000110
11011101
01101110
00001101
11011101
01100110
00001110
11100101
11011101
11100001
00111010
01110100
01011100
11111110
00000010
00110111
00100000
00000001
10100111
00111110
11111111
11001101
01010110
00000101
11011000
11001111
00011010
11011101
01011110
00001011
11011101
01010110
00001100
11100101
01111100
10110101
00100000
00000110
00010011
00010011
00010011
11101011
00011000
00001100
11011101
01101110
11111010
11011101
01100110
11111011
11101011
00110111
11101101
01010010
00111000
00001001
00010001
00000101
00000000
00011001
01000100
01001101
11001101
00000101
00011111
11100001
11011101
01111110
00000000
10100111
00101000
00111110
01111100
10110101
00101000
00010011
00101011
01000110
00101011
01001110
00101011
00000011
00000011
00000011
11011101
00100010
01011111
01011100
11001101
11101000
00011001
11011101
00101010
01011111
01011100
00101010
01011001
01011100
00101011
11011101
01001110
00001011
11011101
01000110
00001100
11000101
00000011
00000011
00000011
11011101
01111110
11111101
11110101
11001101
01010101
00010110
00100011
11110001
01110111
11010001
00100011
01110011
00100011
01110010
00100011
11100101
11011101
11100001
00110111
00111110
11111111
11000011
00000010
00001000
11101011
00101010
01011001
01011100
00101011
11011101
00100010
01011111
01011100
11011101
01001110
00001011
11011101
01000110
00001100
11000101
11001101
11100101
00011001
11000001
11100101
11000101
11001101
01010101
00010110
11011101
00101010
01011111
01011100
00100011
11011101
01001110
00001111
11011101
01000110
00010000
00001001
00100010
01001011
01011100
11011101
01100110
00001110
01111100
11100110
11000000
00100000
00001010
11011101
01101110
00001101
00100010
01000010
01011100
11111101
00110110
00001010
00000000
11010001
11011101
11100001
00110111
00111110
11111111
11000011
00000010
00001000
11011101
01001110
00001011
11011101
01000110
00001100
11000101
00000011
11110111
00110110
10000000
11101011
11010001
11100101
11100101
11011101
11100001
00110111
00111110
11111111
11001101
00000010
00001000
11100001
11101101
01011011
01010011
01011100
01111110
11100110
11000000
00100000
00011001
00011010
00010011
10111110
00100011
00100000
00000010
00011010
10111110
00011011
00101011
00110000
00001000
11100101
11101011
11001101
10111000
00011001
11100001
00011000
11101100
11001101
00101100
00001001
00011000
11100010
01111110
01001111
11111110
10000000
11001000
11100101
00101010
01001011
01011100
01111110
11111110
10000000
00101000
00100101
10111001
00101000
00001000
11000101
11001101
10111000
00011001
11000001
11101011
00011000
11110000
11100110
11100000
11111110
10100000
00100000
00010010
11010001
11010101
11100101
00100011
00010011
00011010
10111110
00100000
00000110
00010111
00110000
11110111
11100001
00011000
00000011
11100001
00011000
11100000
00111110
11111111
11010001
11101011
00111100
00110111
11001101
00101100
00001001
00011000
11000100
00100000
00010000
00001000
00100010
01011111
01011100
11101011
11001101
10111000
00011001
11001101
11101000
00011001
11101011
00101010
01011111
01011100
00001000
00001000
11010101
11001101
10111000
00011001
00100010
01011111
01011100
00101010
01010011
01011100
11100011
11000101
00001000
00111000
00000111
00101011
11001101
01010101
00010110
00100011
00011000
00000011
11001101
01010101
00010110
00100011
11000001
11010001
11101101
01010011
01010011
01011100
11101101
01011011
01011111
01011100
11000101
11010101
11101011
11101101
10110000
11100001
11000001
11010101
11001101
11101000
00011001
11010001
11001001
11100101
00111110
11111101
11001101
00000001
00010110
10101111
00010001
10100001
00001001
11001101
00001010
00001100
11111101
11001011
00000010
11101110
11001101
11010100
00010101
11011101
11100101
00010001
00010001
00000000
10101111
11001101
11000010
00000100
11011101
11100001
00000110
00110010
01110110
00010000
11111101
11011101
01011110
00001011
11011101
01010110
00001100
00111110
11111111
11011101
11100001
11000011
11000010
00000100
10000000
01010011
01110100
01100001
01110010
01110100
00100000
01110100
01100001
01110000
01100101
00101100
00100000
01110100
01101000
01100101
01101110
00100000
01110000
01110010
01100101
01110011
01110011
00100000
01100001
01101110
01111001
00100000
01101011
01100101
01111001
10101110
00001101
01010000
01110010
01101111
01100111
01110010
01100001
01101101
00111010
10100000
00001101
01001110
01110101
01101101
01100010
01100101
01110010
00100000
01100001
01110010
01110010
01100001
01111001
00111010
10100000
00001101
01000011
01101000
01100001
01110010
01100001
01100011
01110100
01100101
01110010
00100000
01100001
01110010
01110010
01100001
01111001
00111010
10100000
00001101
01000010
01111001
01110100
01100101
01110011
00111010
10100000
11001101
00000011
00001011
11111110
00100000
11010010
11011001
00001010
11111110
00000110
00111000
01101001
11111110
00011000
00110000
01100101
00100001
00001011
00001010
01011111
00010110
00000000
00011001
01011110
00011001
11100101
11000011
00000011
00001011
01001110
01010111
00010000
00101001
01010100
01010011
01010010
00110111
01010000
01001111
01011111
01011110
01011101
01011100
01011011
01011010
01010100
01010011
00001100
00111110
00100010
10111001
00100000
00010001
11111101
11001011
00000001
01001110
00100000
00001001
00000100
00001110
00000010
00111110
00011000
10111000
00100000
00000011
00000101
00001110
00100001
11000011
11011001
00001101
00111010
10010001
01011100
11110101
11111101
00110110
01010111
00000001
00111110
00100000
11001101
01100101
00001011
11110001
00110010
10010001
01011100
11001001
11111101
11001011
00000001
01001110
11000010
11001101
00001110
00001110
00100001
11001101
01010101
00001100
00000101
11000011
11011001
00001101
11001101
00000011
00001011
01111001
00111101
00111101
11100110
00010000
00011000
01011010
00111110
00111111
00011000
01101100
00010001
10000111
00001010
00110010
00001111
01011100
00011000
00001011
00010001
01101101
00001010
00011000
00000011
00010001
10000111
00001010
00110010
00001110
01011100
00101010
01010001
01011100
01110011
00100011
01110010
11001001
00010001
11110100
00001001
11001101
10000000
00001010
00101010
00001110
01011100
01010111
01111101
11111110
00010110
11011010
00010001
00100010
00100000
00101001
01000100
01001010
00111110
00011111
10010001
00111000
00001100
11000110
00000010
01001111
11111101
11001011
00000001
01001110
00100000
00010110
00111110
00010110
10010000
11011010
10011111
00011110
00111100
01000111
00000100
11111101
11001011
00000010
01000110
11000010
01010101
00001100
11111101
10111110
00110001
11011010
10000110
00001100
11000011
11011001
00001101
01111100
11001101
00000011
00001011
10000001
00111101
11100110
00011111
11001000
01010111
11111101
11001011
00000001
11000110
00111110
00100000
11001101
00111011
00001100
00010101
00100000
11111000
11001001
11001101
00100100
00001011
11111101
11001011
00000001
01001110
00100000
00011010
11111101
11001011
00000010
01000110
00100000
00001000
11101101
01000011
10001000
01011100
00100010
10000100
01011100
11001001
11101101
01000011
10001010
01011100
11101101
01000011
10000010
01011100
00100010
10000110
01011100
11001001
11111101
01110001
01000101
00100010
10000000
01011100
11001001
11111101
11001011
00000001
01001110
00100000
00010100
11101101
01001011
10001000
01011100
00101010
10000100
01011100
11111101
11001011
00000010
01000110
11001000
11101101
01001011
10001010
01011100
00101010
10000110
01011100
11001001
11111101
01001110
01000101
00101010
10000000
01011100
11001001
11111110
10000000
00111000
00111101
11111110
10010000
00110000
00100110
01000111
11001101
00111000
00001011
11001101
00000011
00001011
00010001
10010010
01011100
00011000
01000111
00100001
10010010
01011100
11001101
00111110
00001011
11001011
00011000
10011111
11100110
00001111
01001111
11001011
00011000
10011111
11100110
11110000
10110001
00001110
00000100
01110111
00100011
00001101
00100000
11111011
11001001
11010110
10100101
00110000
00001001
11000110
00010101
11000101
11101101
01001011
01111011
01011100
00011000
00001011
11001101
00010000
00001100
11000011
00000011
00001011
11000101
11101101
01001011
00110110
01011100
11101011
00100001
00111011
01011100
11001011
10000110
11111110
00100000
00100000
00000010
11001011
11000110
00100110
00000000
01101111
00101001
00101001
00101001
00001001
11000001
11101011
01111001
00111101
00111110
00100001
00100000
00001110
00000101
01001111
11111101
11001011
00000001
01001110
00101000
00000110
11010101
11001101
11001101
00001110
11010001
01111001
10111001
11010101
11001100
01010101
00001100
11010001
11000101
11100101
00111010
10010001
01011100
00000110
11111111
00011111
00111000
00000001
00000100
00011111
00011111
10011111
01001111
00111110
00001000
10100111
11111101
11001011
00000001
01001110
00101000
00000101
11111101
11001011
00110000
11001110
00110111
11101011
00001000
00011010
10100000
10101110
10101001
00010010
00001000
00111000
00010011
00010100
00100011
00111101
00100000
11110010
11101011
00100101
11111101
11001011
00000001
01001110
11001100
11011011
00001011
11100001
11000001
00001101
00100011
11001001
00001000
00111110
00100000
10000011
01011111
00001000
00011000
11100110
01111100
00001111
00001111
00001111
11100110
00000011
11110110
01011000
01100111
11101101
01011011
10001111
01011100
01111110
10101011
10100010
10101011
11111101
11001011
01010111
01110110
00101000
00001000
11100110
11000111
11001011
01010111
00100000
00000010
11101110
00111000
11111101
11001011
01010111
01100110
00101000
00001000
11100110
11111000
11001011
01101111
00100000
00000010
11101110
00000111
01110111
11001001
11100101
00100110
00000000
11100011
00011000
00000100
00010001
10010101
00000000
11110101
11001101
01000001
00001100
00111000
00001001
00111110
00100000
11111101
11001011
00000001
01000110
11001100
00111011
00001100
00011010
11100110
01111111
11001101
00111011
00001100
00011010
00010011
10000111
00110000
11110101
11010001
11111110
01001000
00101000
00000011
11111110
10000010
11011000
01111010
11111110
00000011
11011000
00111110
00100000
11010101
11011001
11010111
11011001
11010001
11001001
11110101
11101011
00111100
11001011
01111110
00100011
00101000
11111011
00111101
00100000
11111000
11101011
11110001
11111110
00100000
11011000
00011010
11010110
01000001
11001001
11111101
11001011
00000001
01001110
11000000
00010001
11011001
00001101
11010101
01111000
11111101
11001011
00000010
01000110
11000010
00000010
00001101
11111101
10111110
00110001
00111000
00011011
11000000
11111101
11001011
00000010
01100110
00101000
00010110
11111101
01011110
00101101
00011101
00101000
01011010
00111110
00000000
11001101
00000001
00010110
11101101
01111011
00111111
01011100
11111101
11001011
00000010
10100110
11001001
11001111
00000100
11111101
00110101
01010010
00100000
01000101
00111110
00011000
10010000
00110010
10001100
01011100
00101010
10001111
01011100
11100101
00111010
10010001
01011100
11110101
00111110
11111101
11001101
00000001
00010110
10101111
00010001
11111000
00001100
11001101
00001010
00001100
11111101
11001011
00000010
11101110
00100001
00111011
01011100
11001011
11011110
11001011
10101110
11011001
11001101
11010100
00010101
11011001
11111110
00100000
00101000
01000101
11111110
11100010
00101000
01000001
11110110
00100000
11111110
01101110
00101000
00111011
00111110
11111110
11001101
00000001
00010110
11110001
00110010
10010001
01011100
11100001
00100010
10001111
01011100
11001101
11111110
00001101
11111101
01000110
00110001
00000100
00001110
00100001
11000101
11001101
10011011
00001110
01111100
00001111
00001111
00001111
11100110
00000011
11110110
01011000
01100111
00010001
11100000
01011010
00011010
01001110
00000110
00100000
11101011
00010010
01110001
00010011
00100011
00010000
11111010
11000001
11001001
10000000
01110011
01100011
01110010
01101111
01101100
01101100
10111111
11001111
00001100
11111110
00000010
00111000
10000000
11111101
10000110
00110001
11010110
00011001
11010000
11101101
01000100
11000101
01000111
00101010
10001111
01011100
11100101
00101010
10010001
01011100
11100101
11001101
01001101
00001101
01111000
11110101
00100001
01101011
01011100
01000110
01111000
00111100
01110111
00100001
10001001
01011100
10111110
00111000
00000011
00110100
00000110
00011000
11001101
00000000
00001110
11110001
00111101
00100000
11101000
11100001
11111101
01110101
01010111
11100001
00100010
10001111
01011100
11101101
01001011
10001000
01011100
11111101
11001011
00000010
10000110
11001101
11011001
00001101
11111101
11001011
00000010
11000110
11000001
11001001
10101111
00101010
10001101
01011100
11111101
11001011
00000010
01000110
00101000
00000100
01100111
11111101
01101110
00001110
00100010
10001111
01011100
00100001
10010001
01011100
00100000
00000010
01111110
00001111
10101110
11100110
01010101
10101110
01110111
11001001
11001101
10101111
00001101
00100001
00111100
01011100
11001011
10101110
11001011
11000110
11001101
01001101
00001101
11111101
01000110
00110001
11001101
01000100
00001110
00100001
11000000
01011010
00111010
10001101
01011100
00000101
00011000
00000111
00001110
00100000
00101011
01110111
00001101
00100000
11111011
00010000
11110111
11111101
00110110
00110001
00000010
00111110
11111101
11001101
00000001
00010110
00101010
01010001
01011100
00010001
11110100
00001001
10100111
01110011
00100011
01110010
00100011
00010001
10101000
00010000
00111111
00111000
11110110
00000001
00100001
00010111
00011000
00101010
00100001
00000000
00000000
00100010
01111101
01011100
11111101
11001011
00110000
10000110
11001101
10010100
00001101
00111110
11111110
11001101
00000001
00010110
11001101
01001101
00001101
00000110
00011000
11001101
01000100
00001110
00101010
01010001
01011100
00010001
11110100
00001001
01110011
00100011
01110010
11111101
00110110
01010010
00000001
00000001
00100001
00011000
00100001
00000000
01011011
11111101
11001011
00000001
01001110
00100000
00010010
01111000
11111101
11001011
00000010
01000110
00101000
00000101
11111101
10000110
00110001
11010110
00011000
11000101
01000111
11001101
10011011
00001110
11000001
00111110
00100001
10010001
01011111
00010110
00000000
00011001
11000011
11011100
00001010
00000110
00010111
11001101
10011011
00001110
00001110
00001000
11000101
11100101
01111000
11100110
00000111
01111000
00100000
00001100
11101011
00100001
11100000
11111000
00011001
11101011
00000001
00100000
00000000
00111101
11101101
10110000
11101011
00100001
11100000
11111111
00011001
11101011
01000111
11100110
00000111
00001111
00001111
00001111
01001111
01111000
00000110
00000000
11101101
10110000
00000110
00000111
00001001
11100110
11111000
00100000
11011011
11100001
00100100
11000001
00001101
00100000
11001101
11001101
10001000
00001110
00100001
11100000
11111111
00011001
11101011
11101101
10110000
00000110
00000001
11000101
11001101
10011011
00001110
00001110
00001000
11000101
11100101
01111000
11100110
00000111
00001111
00001111
00001111
01001111
01111000
00000110
00000000
00001101
01010100
01011101
00110110
00000000
00010011
11101101
10110000
00010001
00000001
00000111
00011001
00111101
11100110
11111000
01000111
00100000
11100101
11100001
00100100
11000001
00001101
00100000
11011100
11001101
10001000
00001110
01100010
01101011
00010011
00111010
10001101
01011100
11111101
11001011
00000010
01000110
00101000
00000011
00111010
01001000
01011100
01110111
00001011
11101101
10110000
11000001
00001110
00100001
11001001
01111100
00001111
00001111
00001111
00111101
11110110
01010000
01100111
11101011
01100001
01101000
00101001
00101001
00101001
00101001
00101001
01000100
01001101
11001001
00111110
00011000
10010000
01010111
00001111
00001111
00001111
11100110
11100000
01101111
01111010
11100110
00011000
11110110
01000000
01100111
11001001
11110011
00000110
10110000
00100001
00000000
01000000
11100101
11000101
11001101
11110100
00001110
11000001
11100001
00100100
01111100
11100110
00000111
00100000
00001010
01111101
11000110
00100000
01101111
00111111
10011111
11100110
11111000
10000100
01100111
00010000
11100111
00011000
00001101
11110011
00100001
00000000
01011011
00000110
00001000
11000101
11001101
11110100
00001110
11000001
00010000
11111001
00111110
00000100
11010011
11111011
11111011
00100001
00000000
01011011
11111101
01110101
01000110
10101111
01000111
01110111
00100011
00010000
11111100
11111101
11001011
00110000
10001110
00001110
00100001
11000011
11011001
00001101
01111000
11111110
00000011
10011111
11100110
00000010
11010011
11111011
01010111
11001101
01010100
00011111
00111000
00001010
00111110
00000100
11010011
11111011
11111011
11001101
11011111
00001110
11001111
00001100
11011011
11111011
10000111
11111000
00110000
11101011
00001110
00100000
01011110
00100011
00000110
00001000
11001011
00010010
11001011
00010011
11001011
00011010
11011011
11111011
00011111
00110000
11111011
01111010
11010011
11111011
00010000
11110000
00001101
00100000
11101001
11001001
00101010
00111101
01011100
11100101
00100001
01111111
00010000
11100101
11101101
01110011
00111101
01011100
11001101
11010100
00010101
11110101
00010110
00000000
11111101
01011110
11111111
00100001
11001000
00000000
11001101
10110101
00000011
11110001
00100001
00111000
00001111
11100101
11111110
00011000
00110000
00110001
11111110
00000111
00111000
00101101
11111110
00010000
00111000
00111010
00000001
00000010
00000000
01010111
11111110
00010110
00111000
00001100
00000011
11111101
11001011
00110111
01111110
11001010
00011110
00010000
11001101
11010100
00010101
01011111
11001101
11010100
00010101
11010101
00101010
01011011
01011100
11111101
11001011
00000111
10000110
11001101
01010101
00010110
11000001
00100011
01110000
00100011
01110001
00011000
00001010
11111101
11001011
00000111
10000110
00101010
01011011
01011100
11001101
01010010
00010110
00010010
00010011
11101101
01010011
01011011
01011100
11001001
01011111
00010110
00000000
00100001
10011001
00001111
00011001
01011110
00011001
11100101
00101010
01011011
01011100
11001001
00001001
01100110
01101010
01010000
10110101
01110000
01111110
11001111
11010100
00101010
01001001
01011100
11111101
11001011
00110111
01101110
11000010
10010111
00010000
11001101
01101110
00011001
11001101
10010101
00010110
01111010
10110011
11001010
10010111
00010000
11100101
00100011
01001110
00100011
01000110
00100001
00001010
00000000
00001001
01000100
01001101
11001101
00000101
00011111
11001101
10010111
00010000
00101010
01010001
01011100
11100011
11100101
00111110
11111111
11001101
00000001
00010110
11100001
00101011
11111101
00110101
00001111
11001101
01010101
00011000
11111101
00110100
00001111
00101010
01011001
01011100
00100011
00100011
00100011
00100011
00100010
01011011
01011100
11100001
11001101
00010101
00010110
11001001
11111101
11001011
00110111
01101110
00100000
00001000
00100001
01001001
01011100
11001101
00001111
00011001
00011000
01101101
11111101
00110110
00000000
00010000
00011000
00011101
11001101
00110001
00010000
00011000
00000101
01111110
11111110
00001101
11001000
00100011
00100010
01011011
01011100
11001001
11001101
00110001
00010000
00000001
00000001
00000000
11000011
11101000
00011001
11001101
11010100
00010101
11001101
11010100
00010101
11100001
11100001
11100001
00100010
00111101
01011100
11111101
11001011
00000000
01111110
11000000
11111001
11001001
00110111
11001101
10010101
00010001
11101101
01010010
00011001
00100011
11000001
11011000
11000101
01000100
01001101
01100010
01101011
00100011
00011010
11100110
11110000
11111110
00010000
00100000
00001001
00100011
00011010
11010110
00010111
11001110
00000000
00100000
00000001
00100011
10100111
11101101
01000010
00001001
11101011
00111000
11100110
11001001
11111101
11001011
00110111
01101110
11000000
00101010
01001001
01011100
11001101
01101110
00011001
11101011
11001101
10010101
00010110
00100001
01001010
01011100
11001101
00011100
00011001
11001101
10010101
00010111
00111110
00000000
11000011
00000001
00010110
11111101
11001011
00110111
01111110
00101000
10101000
11000011
10000001
00001111
11111101
11001011
00110000
01100110
00101000
10100001
11111101
00110110
00000000
11111111
00010110
00000000
11111101
01011110
11111110
00100001
10010000
00011010
11001101
10110101
00000011
11000011
00110000
00001111
11100101
11001101
10010000
00010001
00101011
11001101
11100101
00011001
00100010
01011011
01011100
11111101
00110110
00000111
00000000
11100001
11001001
11111101
11001011
00000010
01011110
11000100
00011101
00010001
10100111
11111101
11001011
00000001
01101110
11001000
00111010
00001000
01011100
11111101
11001011
00000001
10101110
11110101
11111101
11001011
00000010
01101110
11000100
01101110
00001101
11110001
11111110
00100000
00110000
01010010
11111110
00010000
00110000
00101101
11111110
00000110
00110000
00001010
01000111
11100110
00000001
01001111
01111000
00011111
11000110
00010010
00011000
00101010
00100000
00001001
00100001
01101010
01011100
00111110
00001000
10101110
01110111
00011000
00001110
11111110
00001110
11011000
11010110
00001101
00100001
01000001
01011100
10111110
01110111
00100000
00000010
00110110
00000000
11111101
11001011
00000010
11011110
10111111
11001001
01000111
11100110
00000111
01001111
00111110
00010000
11001011
01011000
00100000
00000001
00111100
11111101
01110001
11010011
00010001
00001101
00010001
00011000
00000110
00111010
00001101
01011100
00010001
10101000
00010000
00101010
01001111
01011100
00100011
00100011
01110011
00100011
01110010
00110111
11001001
11001101
01001101
00001101
11111101
11001011
00000010
10011110
11111101
11001011
00000010
10101110
00101010
10001010
01011100
11100101
00101010
00111101
01011100
11100101
00100001
01100111
00010001
11100101
11101101
01110011
00111101
01011100
00101010
10000010
01011100
11100101
00110111
11001101
10010101
00010001
11101011
11001101
01111101
00011000
11101011
11001101
11100001
00011000
00101010
10001010
01011100
11100011
11101011
11001101
01001101
00001101
00111010
10001011
01011100
10010010
00111000
00100110
00100000
00000110
01111011
11111101
10010110
01010000
00110000
00011110
00111110
00100000
11010101
11001101
11110100
00001001
11010001
00011000
11101001
00010110
00000000
11111101
01011110
11111110
00100001
10010000
00011010
11001101
10110101
00000011
11111101
00110110
00000000
11111111
11101101
01011011
10001010
01011100
00011000
00000010
11010001
11100001
11100001
00100010
00111101
01011100
11000001
11010101
11001101
11011001
00001101
11100001
00100010
10000010
01011100
11111101
00110110
00100110
00000000
11001001
00101010
01100001
01011100
00101011
10100111
11101101
01011011
01011001
01011100
11111101
11001011
00110111
01101110
11001000
11101101
01011011
01100001
01011100
11011000
00101010
01100011
01011100
11001001
01111110
11111110
00001110
00000001
00000110
00000000
11001100
11101000
00011001
01111110
00100011
11111110
00001101
00100000
11110001
11001001
11110011
00111110
11111111
11101101
01011011
10110010
01011100
11011001
11101101
01001011
10110100
01011100
11101101
01011011
00111000
01011100
00101010
01111011
01011100
11011001
01000111
00111110
00000111
11010011
11111110
00111110
00111111
11101101
01000111
00000000
00000000
00000000
00000000
00000000
00000000
01100010
01101011
00110110
00000010
00101011
10111100
00100000
11111010
10100111
11101101
01010010
00011001
00100011
00110000
00000110
00110101
00101000
00000011
00110101
00101000
11110011
00101011
11011001
11101101
01000011
10110100
01011100
11101101
01010011
00111000
01011100
00100010
01111011
01011100
11011001
00000100
00101000
00011001
00100010
10110100
01011100
00010001
10101111
00111110
00000001
10101000
00000000
11101011
11101101
10111000
11101011
00100011
00100010
01111011
01011100
00101011
00000001
01000000
00000000
11101101
01000011
00111000
01011100
00100010
10110010
01011100
00100001
00000000
00111100
00100010
00110110
01011100
00101010
10110010
01011100
00110110
00111110
00101011
11111001
00101011
00101011
00100010
00111101
01011100
11101101
01010110
11111101
00100001
00111010
01011100
11111011
00100001
10110110
01011100
00100010
01001111
01011100
00010001
10101111
00010101
00000001
00010101
00000000
11101011
11101101
10110000
11101011
00101011
00100010
01010111
01011100
00100011
00100010
01010011
01011100
00100010
01001011
01011100
00110110
10000000
00100011
00100010
01011001
01011100
00110110
00001101
00100011
00110110
10000000
00100011
00100010
01100001
01011100
00100010
01100011
01011100
00100010
01100101
01011100
00111110
00111000
00110010
10001101
01011100
00110010
10001111
01011100
00110010
01001000
01011100
00100001
00100011
00000101
00100010
00001001
01011100
11111101
00110101
11000110
11111101
00110101
11001010
00100001
11000110
00010101
00010001
00010000
01011100
00000001
00001110
00000000
11101101
10110000
11111101
11001011
00000001
11001110
11001101
11011111
00001110
11111101
00110110
00110001
00000010
11001101
01101011
00001101
10101111
00010001
00111000
00010101
11001101
00001010
00001100
11111101
11001011
00000010
11101110
00011000
00000111
11111101
00110110
00110001
00000010
11001101
10010101
00010111
11001101
10110000
00010110
00111110
00000000
11001101
00000001
00010110
11001101
00101100
00001111
11001101
00010111
00011011
11111101
11001011
00000000
01111110
00100000
00010010
11111101
11001011
00110000
01100110
00101000
01000000
00101010
01011001
01011100
11001101
10100111
00010001
11111101
00110110
00000000
11111111
00011000
11011101
00101010
01011001
01011100
00100010
01011101
01011100
11001101
11111011
00011001
01111000
10110001
11000010
01011101
00010101
11011111
11111110
00001101
00101000
11000000
11111101
11001011
00110000
01000110
11000100
10101111
00001101
11001101
01101110
00001101
00111110
00011001
11111101
10010110
01001111
00110010
10001100
01011100
11111101
11001011
00000001
11111110
11111101
00110110
00000000
11111111
11111101
00110110
00001010
00000001
11001101
10001010
00011011
01110110
11111101
11001011
00000001
10101110
11111101
11001011
00110000
01001110
11000100
11001101
00001110
00111010
00111010
01011100
00111100
11110101
00100001
00000000
00000000
11111101
01110100
00110111
11111101
01110100
00100110
00100010
00001011
01011100
00100001
00000001
00000000
00100010
00010110
01011100
11001101
10110000
00010110
11111101
11001011
00110111
10101110
11001101
01101110
00001101
11111101
11001011
00000010
11101110
11110001
01000111
11111110
00001010
00111000
00000010
11000110
00000111
11001101
11101111
00010101
00111110
00100000
11010111
01111000
00010001
10010001
00010011
11001101
00001010
00001100
10101111
00010001
00110110
00010101
11001101
00001010
00001100
11101101
01001011
01000101
01011100
11001101
00011011
00011010
00111110
00111010
11010111
11111101
01001110
00001101
00000110
00000000
11001101
00011011
00011010
11001101
10010111
00010000
00111010
00111010
01011100
00111100
00101000
00011011
11111110
00001001
00101000
00000100
11111110
00010101
00100000
00000011
11111101
00110100
00001101
00000001
00000011
00000000
00010001
01110000
01011100
00100001
01000100
01011100
11001011
01111110
00101000
00000001
00001001
11101101
10111000
11111101
00110110
00001010
11111111
11111101
11001011
00000001
10011110
11000011
10101100
00010010
10000000
01001111
11001011
01001110
01000101
01011000
01010100
00100000
01110111
01101001
01110100
01101000
01101111
01110101
01110100
00100000
01000110
01001111
11010010
01010110
01100001
01110010
01101001
01100001
01100010
01101100
01100101
00100000
01101110
01101111
01110100
00100000
01100110
01101111
01110101
01101110
11100100
01010011
01110101
01100010
01110011
01100011
01110010
01101001
01110000
01110100
00100000
01110111
01110010
01101111
01101110
11100111
01001111
01110101
01110100
00100000
01101111
01100110
00100000
01101101
01100101
01101101
01101111
01110010
11111001
01001111
01110101
01110100
00100000
01101111
01100110
00100000
01110011
01100011
01110010
01100101
01100101
11101110
01001110
01110101
01101101
01100010
01100101
01110010
00100000
01110100
01101111
01101111
00100000
01100010
01101001
11100111
01010010
01000101
01010100
01010101
01010010
01001110
00100000
01110111
01101001
01110100
01101000
01101111
01110101
01110100
00100000
01000111
01001111
01010011
01010101
11000010
01000101
01101110
01100100
00100000
01101111
01100110
00100000
01100110
01101001
01101100
11100101
01010011
01010100
01001111
01010000
00100000
01110011
01110100
01100001
01110100
01100101
01101101
01100101
01101110
11110100
01001001
01101110
01110110
01100001
01101100
01101001
01100100
00100000
01100001
01110010
01100111
01110101
01101101
01100101
01101110
11110100
01001001
01101110
01110100
01100101
01100111
01100101
01110010
00100000
01101111
01110101
01110100
00100000
01101111
01100110
00100000
01110010
01100001
01101110
01100111
11100101
01001110
01101111
01101110
01110011
01100101
01101110
01110011
01100101
00100000
01101001
01101110
00100000
01000010
01000001
01010011
01001001
11000011
01000010
01010010
01000101
01000001
01001011
00100000
00101101
00100000
01000011
01001111
01001110
01010100
00100000
01110010
01100101
01110000
01100101
01100001
01110100
11110011
01001111
01110101
01110100
00100000
01101111
01100110
00100000
01000100
01000001
01010100
11000001
01001001
01101110
01110110
01100001
01101100
01101001
01100100
00100000
01100110
01101001
01101100
01100101
00100000
01101110
01100001
01101101
11100101
01001110
01101111
00100000
01110010
01101111
01101111
01101101
00100000
01100110
01101111
01110010
00100000
01101100
01101001
01101110
11100101
01010011
01010100
01001111
01010000
00100000
01101001
01101110
00100000
01001001
01001110
01010000
01010101
11010100
01000110
01001111
01010010
00100000
01110111
01101001
01110100
01101000
01101111
01110101
01110100
00100000
01001110
01000101
01011000
11010100
01001001
01101110
01110110
01100001
01101100
01101001
01100100
00100000
01001001
00101111
01001111
00100000
01100100
01100101
01110110
01101001
01100011
11100101
01001001
01101110
01110110
01100001
01101100
01101001
01100100
00100000
01100011
01101111
01101100
01101111
01110101
11110010
01000010
01010010
01000101
01000001
01001011
00100000
01101001
01101110
01110100
01101111
00100000
01110000
01110010
01101111
01100111
01110010
01100001
11101101
01010010
01000001
01001101
01010100
01001111
01010000
00100000
01101110
01101111
00100000
01100111
01101111
01101111
11100100
01010011
01110100
01100001
01110100
01100101
01101101
01100101
01101110
01110100
00100000
01101100
01101111
01110011
11110100
01001001
01101110
01110110
01100001
01101100
01101001
01100100
00100000
01110011
01110100
01110010
01100101
01100001
11101101
01000110
01001110
00100000
01110111
01101001
01110100
01101000
01101111
01110101
01110100
00100000
01000100
01000101
11000110
01010000
01100001
01110010
01100001
01101101
01100101
01110100
01100101
01110010
00100000
01100101
01110010
01110010
01101111
11110010
01010100
01100001
01110000
01100101
00100000
01101100
01101111
01100001
01100100
01101001
01101110
01100111
00100000
01100101
01110010
01110010
01101111
11110010
00101100
10100000
01111111
00100000
00110001
00111001
00111000
00110010
00100000
01010011
01101001
01101110
01100011
01101100
01100001
01101001
01110010
00100000
01010010
01100101
01110011
01100101
01100001
01110010
01100011
01101000
00100000
01001100
01110100
11100100
00111110
00010000
00000001
00000000
00000000
11000011
00010011
00010011
11101101
01000011
01001001
01011100
00101010
01011101
01011100
11101011
00100001
01010101
00010101
11100101
00101010
01100001
01011100
00110111
11101101
01010010
11100101
01100000
01101001
11001101
01101110
00011001
00100000
00000110
11001101
10111000
00011001
11001101
11101000
00011001
11000001
01111001
00111101
10110000
00101000
00101000
11000101
00000011
00000011
00000011
00000011
00101011
11101101
01011011
01010011
01011100
11010101
11001101
01010101
00010110
11100001
00100010
01010011
01011100
11000001
11000101
00010011
00101010
01100001
01011100
00101011
00101011
11101101
10111000
00101010
01001001
01011100
11101011
11000001
01110000
00101011
01110001
00101011
01110011
00101011
01110010
11110001
11000011
10100010
00010010
11110100
00001001
10101000
00010000
01001011
11110100
00001001
11000100
00010101
01010011
10000001
00001111
11000100
00010101
01010010
11110100
00001001
11000100
00010101
01010000
10000000
11001111
00010010
00000001
00000000
00000110
00000000
00001011
00000000
00000001
00000000
00000001
00000000
00000110
00000000
00010000
00000000
11111101
11001011
00000010
01101110
00100000
00000100
11111101
11001011
00000010
11011110
11001101
11100110
00010101
11011000
00101000
11111010
11001111
00000111
11011001
11100101
00101010
01010001
01011100
00100011
00100011
00011000
00001000
00011110
00110000
10000011
11011001
11100101
00101010
01010001
01011100
01011110
00100011
01010110
11101011
11001101
00101100
00010110
11100001
11011001
11001001
10000111
11000110
00010110
01101111
00100110
01011100
01011110
00100011
01010110
01111010
10110011
00100000
00000010
11001111
00010111
00011011
00101010
01001111
01011100
00011001
00100010
01010001
01011100
11111101
11001011
00110000
10100110
00100011
00100011
00100011
00100011
01001110
00100001
00101101
00010110
11001101
11011100
00010110
11010000
00010110
00000000
01011110
00011001
11101001
01001011
00000110
01010011
00010010
01010000
00011011
00000000
11111101
11001011
00000010
11000110
11111101
11001011
00000001
10101110
11111101
11001011
00110000
11100110
00011000
00000100
11111101
11001011
00000010
10000110
11111101
11001011
00000001
10001110
11000011
01001101
00001101
11111101
11001011
00000001
11001110
11001001
00000001
00000001
00000000
11100101
11001101
00000101
00011111
11100001
11001101
01100100
00010110
00101010
01100101
01011100
11101011
11101101
10111000
11001001
11110101
11100101
00100001
01001011
01011100
00111110
00001110
01011110
00100011
01010110
11100011
10100111
11101101
01010010
00011001
11100011
00110000
00001001
11010101
11101011
00001001
11101011
01110010
00101011
01110011
00100011
11010001
00100011
00111101
00100000
11101000
11101011
11010001
11110001
10100111
11101101
01010010
01000100
01001101
00000011
00011001
11101011
11001001
00000000
00000000
11101011
00010001
10001111
00010110
01111110
11100110
11000000
00100000
11110111
01010110
00100011
01011110
11001001
00101010
01100011
01011100
00101011
11001101
01010101
00010110
00100011
00100011
11000001
11101101
01000011
01100001
01011100
11000001
11101011
00100011
11001001
00101010
01011001
01011100
00110110
00001101
00100010
01011011
01011100
00100011
00110110
10000000
00100011
00100010
01100001
01011100
00101010
01100001
01011100
00100010
01100011
01011100
00101010
01100011
01011100
00100010
01100101
01011100
11100101
00100001
10010010
01011100
00100010
01101000
01011100
11100001
11001001
11101101
01011011
01011001
01011100
11000011
11100101
00011001
00100011
01111110
10100111
11001000
10111001
00100011
00100000
11111000
00110111
11001001
11001101
00011110
00010111
11001101
00000001
00010111
00000001
00000000
00000000
00010001
11100010
10100011
11101011
00011001
00111000
00000111
00000001
11010100
00010101
00001001
01001110
00100011
01000110
11101011
01110001
00100011
01110000
11001001
11100101
00101010
01001111
01011100
00001001
00100011
00100011
00100011
01001110
11101011
00100001
00010110
00010111
11001101
11011100
00010110
01001110
00000110
00000000
00001001
11101001
01001011
00000101
01010011
00000011
01010000
00000001
11100001
11001001
11001101
10010100
00011110
11111110
00010000
00111000
00000010
11001111
00010111
11000110
00000011
00000111
00100001
00010000
01011100
01001111
00000110
00000000
00001001
01001110
00100011
01000110
00101011
11001001
11101111
00000001
00111000
11001101
00011110
00010111
01111000
10110001
00101000
00010110
11101011
00101010
01001111
01011100
00001001
00100011
00100011
00100011
01111110
11101011
11111110
01001011
00101000
00001000
11111110
01010011
00101000
00000100
11111110
01010000
00100000
11001111
11001101
01011101
00010111
01110011
00100011
01110010
11001001
11100101
11001101
11110001
00101011
01111000
10110001
00100000
00000010
11001111
00001110
11000101
00011010
11100110
11011111
01001111
00100001
01111010
00010111
11001101
11011100
00010110
00110000
11110001
01001110
00000110
00000000
00001001
11000001
11101001
01001011
00000110
01010011
00001000
01010000
00001010
00000000
00011110
00000001
00011000
00000110
00011110
00000110
00011000
00000010
00011110
00010000
00001011
01111000
10110001
00100000
11010101
01010111
11100001
11001001
00011000
10010000
11101101
01110011
00111111
01011100
11111101
00110110
00000010
00010000
11001101
10101111
00001101
11111101
11001011
00000010
11000110
11111101
01000110
00110001
11001101
01000100
00001110
11111101
11001011
00000010
10000110
11111101
11001011
00110000
11000110
00101010
01001001
01011100
11101101
01011011
01101100
01011100
10100111
11101101
01010010
00011001
00111000
00100010
11010101
11001101
01101110
00011001
00010001
11000000
00000010
11101011
11101101
01010010
11100011
11001101
01101110
00011001
11000001
11000101
11001101
10111000
00011001
11000001
00001001
00111000
00001110
11101011
01010110
00100011
01011110
00101011
11101101
01010011
01101100
01011100
00011000
11101101
00100010
01101100
01011100
00101010
01101100
01011100
11001101
01101110
00011001
00101000
00000001
11101011
11001101
00110011
00011000
11111101
11001011
00000010
10100110
11001001
00111110
00000011
00011000
00000010
00111110
00000010
11111101
00110110
00000010
00000000
11001101
00110000
00100101
11000100
00000001
00010110
11011111
11001101
01110000
00100000
00111000
00010100
11011111
11111110
00111011
00101000
00000100
11111110
00101100
00100000
00000110
11100111
11001101
10000010
00011100
00011000
00001000
11001101
11100110
00011100
00011000
00000011
11001101
11011110
00011100
11001101
11101110
00011011
11001101
10011001
00011110
01111000
11100110
00111111
01100111
01101001
00100010
01001001
01011100
11001101
01101110
00011001
00011110
00000001
11001101
01010101
00011000
11010111
11111101
11001011
00000010
01100110
00101000
11110110
00111010
01101011
01011100
11111101
10010110
01001111
00100000
11101110
10101011
11001000
11100101
11010101
00100001
01101100
01011100
11001101
00001111
00011001
11010001
11100001
00011000
11100000
11101101
01001011
01001001
01011100
11001101
10000000
00011001
00010110
00111110
00101000
00000101
00010001
00000000
00000000
11001011
00010011
11111101
01110011
00101101
01111110
11111110
01000000
11000001
11010000
11000101
11001101
00101000
00011010
00100011
00100011
00100011
11111101
11001011
00000001
10000110
01111010
10100111
00101000
00000101
11010111
11111101
11001011
00000001
11000110
11010101
11101011
11111101
11001011
00110000
10010110
00100001
00111011
01011100
11001011
10010110
11111101
11001011
00110111
01101110
00101000
00000010
11001011
11010110
00101010
01011111
01011100
10100111
11101101
01010010
00100000
00000101
00111110
00111111
11001101
11000001
00011000
11001101
11100001
00011000
11101011
01111110
11001101
10110110
00011000
00100011
11111110
00001101
00101000
00000110
11101011
11001101
00110111
00011001
00011000
11100000
11010001
11001001
11111110
00001110
11000000
00100011
00100011
00100011
00100011
00100011
00100011
01111110
11001001
11011001
00101010
10001111
01011100
11100101
11001011
10111100
11001011
11111101
00100010
10001111
01011100
00100001
10010001
01011100
01010110
11010101
00110110
00000000
11001101
11110100
00001001
11100001
11111101
01110100
01010111
11100001
00100010
10001111
01011100
11011001
11001001
00101010
01011011
01011100
10100111
11101101
01010010
11000000
00111010
01000001
01011100
11001011
00000111
00101000
00000100
11000110
01000011
00011000
00010110
00100001
00111011
01011100
11001011
10011110
00111110
01001011
11001011
01010110
00101000
00001011
11001011
11011110
00111100
11111101
11001011
00110000
01011110
00101000
00000010
00111110
01000011
11010101
11001101
11000001
00011000
11010001
11001001
01011110
00100011
01010110
11100101
11101011
00100011
11001101
01101110
00011001
11001101
10010101
00010110
11100001
11111101
11001011
00110111
01101110
11000000
01110010
00101011
01110011
11001001
01111011
10100111
11111000
00011000
00001101
10101111
00001001
00111100
00111000
11111100
11101101
01000010
00111101
00101000
11110001
11000011
11101111
00010101
11001101
00011011
00101101
00110000
00110000
11111110
00100001
00111000
00101100
11111101
11001011
00000001
10010110
11111110
11001011
00101000
00100100
11111110
00111010
00100000
00001110
11111101
11001011
00110111
01101110
00100000
00010110
11111101
11001011
00110000
01010110
00101000
00010100
00011000
00001110
11111110
00100010
00100000
00001010
11110101
00111010
01101010
01011100
11101110
00000100
00110010
01101010
01011100
11110001
11111101
11001011
00000001
11010110
11010111
11001001
11100101
00101010
01010011
01011100
01010100
01011101
11000001
11001101
10000000
00011001
11010000
11000101
11001101
10111000
00011001
11101011
00011000
11110100
01111110
10111000
11000000
00100011
01111110
00101011
10111001
11001001
00100011
00100011
00100011
00100010
01011101
01011100
00001110
00000000
00010101
11001000
11100111
10111011
00100000
00000100
10100111
11001001
00100011
01111110
11001101
10110110
00011000
00100010
01011101
01011100
11111110
00100010
00100000
00000001
00001101
11111110
00111010
00101000
00000100
11111110
11001011
00100000
00000100
11001011
01000001
00101000
11011111
11111110
00001101
00100000
11100011
00010101
00110111
11001001
11100101
01111110
11111110
01000000
00111000
00010111
11001011
01101111
00101000
00010100
10000111
11111010
11000111
00011001
00111111
00000001
00000101
00000000
00110000
00000010
00001110
00010010
00010111
00100011
01111110
00110000
11111011
00011000
00000110
00100011
00100011
01001110
00100011
01000110
00100011
00001001
11010001
10100111
11101101
01010010
01000100
01001101
00011001
11101011
11001001
11001101
11011101
00011001
11000101
01111000
00101111
01000111
01111001
00101111
01001111
00000011
11001101
01100100
00010110
11101011
11100001
00011001
11010101
11101101
10110000
11100001
11001001
00101010
01011001
01011100
00101011
00100010
01011101
01011100
11100111
00100001
10010010
01011100
00100010
01100101
01011100
11001101
00111011
00101101
11001101
10100010
00101101
00111000
00000100
00100001
11110000
11011000
00001001
11011010
10001010
00011100
11000011
11000101
00010110
11010101
11100101
10101111
11001011
01111000
00100000
00100000
01100000
01101001
00011110
11111111
00011000
00001000
11010101
01010110
00100011
01011110
11100101
11101011
00011110
00100000
00000001
00011000
11111100
11001101
00101010
00011001
00000001
10011100
11111111
11001101
00101010
00011001
00001110
11110110
11001101
00101010
00011001
01111101
11001101
11101111
00010101
11100001
11010001
11001001
10110001
11001011
10111100
10111111
11000100
10101111
10110100
10010011
10010001
10010010
10010101
10011000
10011000
10011000
10011000
10011000
10011000
10011000
01111111
10000001
00101110
01101100
01101110
01110000
01001000
10010100
01010110
00111111
01000001
00101011
00010111
00011111
00110111
01110111
01000100
00001111
01011001
00101011
01000011
00101101
01010001
00111010
01101101
01000010
00001101
01001001
01011100
01000100
00010101
01011101
00000001
00111101
00000010
00000110
00000000
01100111
00011110
00000110
11001011
00000101
11110000
00011100
00000110
00000000
11101101
00011110
00000000
11101110
00011100
00000000
00100011
00011111
00000100
00111101
00000110
11001100
00000110
00000101
00000011
00011101
00000100
00000000
10101011
00011101
00000101
11001101
00011111
00000101
10001001
00100000
00000101
00000010
00101100
00000101
10110010
00011011
00000000
10110111
00010001
00000011
10100001
00011110
00000101
11111001
00010111
00001000
00000000
10000000
00011110
00000011
01001111
00011110
00000000
01011111
00011110
00000011
10101100
00011110
00000000
01101011
00001101
00001001
00000000
11011100
00100010
00000110
00000000
00111010
00011111
00000101
11101101
00011101
00000101
00100111
00011110
00000011
01000010
00011110
00001001
00000101
10000010
00100011
00000000
10101100
00001110
00000101
11001001
00011111
00000101
11110101
00010111
00001011
00001011
00001011
00001011
00001000
00000000
11111000
00000011
00001001
00000101
00100000
00100011
00000111
00000111
00000111
00000111
00000111
00000111
00001000
00000000
01111010
00011110
00000110
00000000
10010100
00100010
00000101
01100000
00011111
00000110
00101100
00001010
00000000
00110110
00010111
00000110
00000000
11100101
00010110
00001010
00000000
10010011
00010111
00001010
00101100
00001010
00000000
10010011
00010111
00001010
00000000
10010011
00010111
00000000
10010011
00010111
11111101
11001011
00000001
10111110
11001101
11111011
00011001
10101111
00110010
01000111
01011100
00111101
00110010
00111010
01011100
00011000
00000001
11100111
11001101
10111111
00010110
11111101
00110100
00001101
11111010
10001010
00011100
11011111
00000110
00000000
11111110
00001101
00101000
01111010
11111110
00111010
00101000
11101011
00100001
01110110
00011011
11100101
01001111
11100111
01111001
11010110
11001110
11011010
10001010
00011100
01001111
00100001
01001000
00011010
00001001
01001110
00001001
00011000
00000011
00101010
01110100
01011100
01111110
00100011
00100010
01110100
01011100
00000001
01010010
00011011
11000101
01001111
11111110
00100000
00110000
00001100
00100001
00000001
00011100
00000110
00000000
00001001
01001110
00001001
11100101
11011111
00000101
11001001
11011111
10111001
11000010
10001010
00011100
11100111
11001001
11001101
01010100
00011111
00111000
00000010
11001111
00010100
11111101
11001011
00001010
01111110
00100000
01110001
00101010
01000010
01011100
11001011
01111100
00101000
00010100
00100001
11111110
11111111
00100010
01000101
01011100
00101010
01100001
01011100
00101011
11101101
01011011
01011001
01011100
00011011
00111010
01000100
01011100
00011000
00110011
11001101
01101110
00011001
00111010
01000100
01011100
00101000
00011001
10100111
00100000
01000011
01000111
01111110
11100110
11000000
01111000
00101000
00001111
11001111
11111111
11000001
11001101
00110000
00100101
11001000
00101010
01010101
01011100
00111110
11000000
10100110
11000000
10101111
11111110
00000001
11001110
00000000
01010110
00100011
01011110
11101101
01010011
01000101
01011100
00100011
01011110
00100011
01010110
11101011
00011001
00100011
00100010
01010101
01011100
11101011
00100010
01011101
01011100
01010111
00011110
00000000
11111101
00110110
00001010
11111111
00010101
11111101
01110010
00001101
11001010
00101000
00011011
00010100
11001101
10001011
00011001
00101000
00001000
11001111
00010110
11001101
00110000
00100101
11000000
11000001
11000001
11011111
11111110
00001101
00101000
10111010
11111110
00111010
11001010
00101000
00011011
11000011
10001010
00011100
00001111
00011101
01001011
00001001
01100111
00001011
01111011
10001110
01110001
10110100
10000001
11001111
11001101
11011110
00011100
10111111
11000001
11001100
11101110
00011011
11101011
00101010
01110100
01011100
01001110
00100011
01000110
11101011
11000101
11001001
11001101
10110010
00101000
11111101
00110110
00110111
00000000
00110000
00001000
11111101
11001011
00110111
11001110
00100000
00011000
11001111
00000001
11001100
10010110
00101001
11111101
11001011
00000001
01110110
00100000
00001101
10101111
11001101
00110000
00100101
11000100
11110001
00101011
00100001
01110001
01011100
10110110
01110111
11101011
11101101
01000011
01110010
01011100
00100010
01001101
01011100
11001001
11000001
11001101
01010110
00011100
11001101
11101110
00011011
11001001
00111010
00111011
01011100
11110101
11001101
11111011
00100100
11110001
11111101
01010110
00000001
10101010
11100110
01000000
00100000
00100100
11001011
01111010
11000010
11111111
00101010
11001001
11001101
10110010
00101000
11110101
01111001
11110110
10011111
00111100
00100000
00010100
11110001
00011000
10101001
11100111
11001101
10000010
00011100
11111110
00101100
00100000
00001001
11100111
11001101
11111011
00100100
11111101
11001011
00000001
01110110
11000000
11001111
00001011
11001101
11111011
00100100
11111101
11001011
00000001
01110110
11001000
00011000
11110100
11111101
11001011
00000001
01111110
11111101
11001011
00000010
10000110
11000100
01001101
00001101
11110001
00111010
01110100
01011100
11010110
00010011
11001101
11111100
00100001
11001101
11101110
00011011
00101010
10001111
01011100
00100010
10001101
01011100
00100001
10010001
01011100
01111110
00000111
10101110
11100110
10101010
10101110
01110111
11001001
11001101
00110000
00100101
00101000
00010011
11111101
11001011
00000010
10000110
11001101
01001101
00001101
00100001
10010000
01011100
01111110
11110110
11111000
01110111
11111101
11001011
01010111
10110110
11011111
11001101
11100010
00100001
00011000
10011111
11000011
00000101
00000110
11111110
00001101
00101000
00000100
11111110
00111010
00100000
10011100
11001101
00110000
00100101
11001000
11101111
10100000
00111000
11001001
11001111
00001000
11000001
11001101
00110000
00100101
00101000
00001010
11101111
00000010
00111000
11101011
11001101
11101001
00110100
11011010
10110011
00011011
11000011
00101001
00011011
11111110
11001101
00100000
00001001
11100111
11001101
10000010
00011100
11001101
11101110
00011011
00011000
00000110
11001101
11101110
00011011
11101111
10100001
00111000
11101111
11000000
00000010
00000001
11100000
00000001
00111000
11001101
11111111
00101010
00100010
01101000
01011100
00101011
01111110
11001011
11111110
00000001
00000110
00000000
00001001
00000111
00111000
00000110
00001110
00001101
11001101
01010101
00010110
00100011
11100101
11101111
00000010
00000010
00111000
11100001
11101011
00001110
00001010
11101101
10110000
00101010
01000101
01011100
11101011
01110011
00100011
01110010
11111101
01010110
00001101
00010100
00100011
01110010
11001101
11011010
00011101
11010000
11111101
01000110
00111000
00101010
01000101
01011100
00100010
01000010
01011100
00111010
01000111
01011100
11101101
01000100
01010111
00101010
01011101
01011100
00011110
11110011
11000101
11101101
01001011
01010101
01011100
11001101
10000110
00011101
11101101
01000011
01010101
01011100
11000001
00111000
00010001
11100111
11110110
00100000
10111000
00101000
00000011
11100111
00011000
11101000
11100111
00111110
00000001
10010010
00110010
01000100
01011100
11001001
11001111
00010001
01111110
11111110
00111010
00101000
00011000
00100011
01111110
11100110
11000000
00110111
11000000
01000110
00100011
01001110
11101101
01000011
01000010
01011100
00100011
01001110
00100011
01000110
11100101
00001001
01000100
01001101
11100001
00010110
00000000
11000101
11001101
10001011
00011001
11000001
11010000
00011000
11100000
11111101
11001011
00110111
01001110
11000010
00101110
00011100
00101010
01001101
01011100
11001011
01111110
00101000
00011111
00100011
00100010
01101000
01011100
11101111
11100000
11100010
00001111
11000000
00000010
00111000
11001101
11011010
00011101
11011000
00101010
01101000
01011100
00010001
00001111
00000000
00011001
01011110
00100011
01010110
00100011
01100110
11101011
11000011
01110011
00011110
11001111
00000000
11101111
11100001
11100000
11100010
00110110
00000000
00000010
00000001
00000011
00110111
00000000
00000100
00111000
10100111
11001001
00111000
00110111
11001001
11100111
11001101
00011111
00011100
11001101
00110000
00100101
00101000
00101001
11011111
00100010
01011111
01011100
00101010
01010111
01011100
01111110
11111110
00101100
00101000
00001001
00011110
11100100
11001101
10000110
00011101
00110000
00000010
11001111
00001101
11001101
01110111
00000000
11001101
01010110
00011100
11011111
00100010
01010111
01011100
00101010
01011111
01011100
11111101
00110110
00100110
00000000
11001101
01111000
00000000
11011111
11111110
00101100
00101000
11001001
11001101
11101110
00011011
11001001
11001101
00110000
00100101
00100000
00001011
11001101
11111011
00100100
11111110
00101100
11000100
11101110
00011011
11100111
00011000
11110101
00111110
11100100
01000111
11101101
10111001
00010001
00000000
00000010
11000011
10001011
00011001
11001101
10011001
00011110
01100000
01101001
11001101
01101110
00011001
00101011
00100010
01010111
01011100
11001001
11001101
10011001
00011110
01111000
10110001
00100000
00000100
11101101
01001011
01111000
01011100
11101101
01000011
01110110
01011100
11001001
00101010
01101110
01011100
11111101
01010110
00110110
00011000
00001100
11001101
10011001
00011110
01100000
01101001
00010110
00000000
01111100
11111110
11110000
00110000
00101100
00100010
01000010
01011100
11111101
01110010
00001010
11001001
11001101
10000101
00011110
11101101
01111001
11001001
11001101
10000101
00011110
00000010
11001001
11001101
11010101
00101101
00111000
00010101
00101000
00000010
11101101
01000100
11110101
11001101
10011001
00011110
11110001
11001001
11001101
11010101
00101101
00011000
00000011
11001101
10100010
00101101
00111000
00000001
11001000
11001111
00001010
11001101
01100111
00011110
00000001
00000000
00000000
11001101
01000101
00011110
00011000
00000011
11001101
10011001
00011110
01111000
10110001
00100000
00000100
11101101
01001011
10110010
01011100
11000101
11101101
01011011
01001011
01011100
00101010
01011001
01011100
00101011
11001101
11100101
00011001
11001101
01101011
00001101
00101010
01100101
01011100
00010001
00110010
00000000
00011001
11010001
11101101
01010010
00110000
00001000
00101010
10110100
01011100
10100111
11101101
01010010
00110000
00000010
11001111
00010101
11101011
00100010
10110010
01011100
11010001
11000001
00110110
00111110
00101011
11111001
11000101
11101101
01110011
00111101
01011100
11101011
11101001
11010001
11111101
01100110
00001101
00100100
11100011
00110011
11101101
01001011
01000101
01011100
11000101
11100101
11101101
01110011
00111101
01011100
11010101
11001101
01100111
00011110
00000001
00010100
00000000
00101010
01100101
01011100
00001001
00111000
00001010
11101011
00100001
01010000
00000000
00011001
00111000
00000011
11101101
01110010
11011000
00101110
00000011
11000011
01010101
00000000
00000001
00000000
00000000
11001101
00000101
00011111
01000100
01001101
11001001
11000001
11100001
11010001
01111010
11111110
00111110
00101000
00001011
00111011
11100011
11101011
11101101
01110011
00111101
01011100
11000101
11000011
01110011
00011110
11010101
11100101
11001111
00000110
11001101
10011001
00011110
01110110
00001011
01111000
10110001
00101000
00001100
01111000
10100001
00111100
00100000
00000001
00000011
11111101
11001011
00000001
01101110
00101000
11101110
11111101
11001011
00000001
10101110
11001001
00111110
01111111
11011011
11111110
00011111
11011000
00111110
11111110
11011011
11111110
00011111
11001001
11001101
00110000
00100101
00101000
00000101
00111110
11001110
11000011
00111001
00011110
11111101
11001011
00000001
11110110
11001101
10001101
00101100
00110000
00010110
11100111
11111110
00100100
00100000
00000101
11111101
11001011
00000001
10110110
11100111
11111110
00101000
00100000
00111100
11100111
11111110
00101001
00101000
00100000
11001101
10001101
00101100
11010010
10001010
00011100
11101011
11100111
11111110
00100100
00100000
00000010
11101011
11100111
11101011
00000001
00000110
00000000
11001101
01010101
00010110
00100011
00100011
00110110
00001110
11111110
00101100
00100000
00000011
11100111
00011000
11100000
11111110
00101001
00100000
00010011
11100111
11111110
00111101
00100000
00001110
11100111
00111010
00111011
01011100
11110101
11001101
11111011
00100100
11110001
11111101
10101110
00000001
11100110
01000000
11000010
10001010
00011100
11001101
11101110
00011011
11001101
00110000
00100101
11100001
11001000
11101001
00111110
00000011
00011000
00000010
00111110
00000010
11001101
00110000
00100101
11000100
00000001
00010110
11001101
01001101
00001101
11001101
11011111
00011111
11001101
11101110
00011011
11001001
11011111
11001101
01000101
00100000
00101000
00001101
11001101
01001110
00100000
00101000
11111011
11001101
11111100
00011111
11001101
01001110
00100000
00101000
11110011
11111110
00101001
11001000
11001101
11000011
00011111
00111110
00001101
11010111
11001001
11011111
11111110
10101100
00100000
00001101
11001101
01111001
00011100
11001101
11000011
00011111
11001101
00000111
00100011
00111110
00010110
00011000
00010000
11111110
10101101
00100000
00010010
11100111
11001101
10000010
00011100
11001101
11000011
00011111
11001101
10011001
00011110
00111110
00010111
11010111
01111001
11010111
01111000
11010111
11001001
11001101
11110010
00100001
11010000
11001101
01110000
00100000
11010000
11001101
11111011
00100100
11001101
11000011
00011111
11111101
11001011
00000001
01110110
11001100
11110001
00101011
11000010
11100011
00101101
01111000
10110001
00001011
11001000
00011010
00010011
11010111
00011000
11110111
11111110
00101001
11001000
11111110
00001101
11001000
11111110
00111010
11001001
11011111
11111110
00111011
00101000
00010100
11111110
00101100
00100000
00001010
11001101
00110000
00100101
00101000
00001011
00111110
00000110
11010111
00011000
00000110
11111110
00100111
11000000
11001101
11110101
00011111
11100111
11001101
01000101
00100000
00100000
00000001
11000001
10111111
11001001
11111110
00100011
00110111
11000000
11100111
11001101
10000010
00011100
10100111
11001101
11000011
00011111
11001101
10010100
00011110
11111110
00010000
11010010
00001110
00010110
11001101
00000001
00010110
10100111
11001001
11001101
00110000
00100101
00101000
00001000
00111110
00000001
11001101
00000001
00010110
11001101
01101110
00001101
11111101
00110110
00000010
00000001
11001101
11000001
00100000
11001101
11101110
00011011
11101101
01001011
10001000
01011100
00111010
01101011
01011100
10111000
00111000
00000011
00001110
00100001
01000111
11101101
01000011
10001000
01011100
00111110
00011001
10010000
00110010
10001100
01011100
11111101
11001011
00000010
10000110
11001101
11011001
00001101
11000011
01101110
00001101
11001101
01001110
00100000
00101000
11111011
11111110
00101000
00100000
00001110
11100111
11001101
11011111
00011111
11011111
11111110
00101001
11000010
10001010
00011100
11100111
11000011
10110010
00100001
11111110
11001010
00100000
00010001
11100111
11001101
00011111
00011100
11111101
11001011
00110111
11111110
11111101
11001011
00000001
01110110
11000010
10001010
00011100
00011000
00001101
11001101
10001101
00101100
11010010
10101111
00100001
11001101
00011111
00011100
11111101
11001011
00110111
10111110
11001101
00110000
00100101
11001010
10110010
00100001
11001101
10111111
00010110
00100001
01110001
01011100
11001011
10110110
11001011
11101110
00000001
00000001
00000000
11001011
01111110
00100000
00001011
00111010
00111011
01011100
11100110
01000000
00100000
00000010
00001110
00000011
10110110
01110111
11110111
00110110
00001101
01111001
00001111
00001111
00110000
00000101
00111110
00100010
00010010
00101011
01110111
00100010
01011011
01011100
11111101
11001011
00110111
01111110
00100000
00101100
00101010
01011101
01011100
11100101
00101010
00111101
01011100
11100101
00100001
00111010
00100001
11100101
11111101
11001011
00110000
01100110
00101000
00000100
11101101
01110011
00111101
01011100
00101010
01100001
01011100
11001101
10100111
00010001
11111101
00110110
00000000
11111111
11001101
00101100
00001111
11111101
11001011
00000001
10111110
11001101
10111001
00100001
00011000
00000011
11001101
00101100
00001111
11111101
00110110
00100010
00000000
11001101
11010110
00100001
00100000
00001010
11001101
00011101
00010001
11101101
01001011
10000010
01011100
11001101
11011001
00001101
00100001
01110001
01011100
11001011
10101110
11001011
01111110
11001011
10111110
00100000
00011100
11100001
11100001
00100010
00111101
01011100
11100001
00100010
01011111
01011100
11111101
11001011
00000001
11111110
11001101
10111001
00100001
00101010
01011111
01011100
11111101
00110110
00100110
00000000
00100010
01011101
01011100
00011000
00010111
00101010
01100011
01011100
11101101
01011011
01100001
01011100
00110111
11101101
01010010
01000100
01001101
11001101
10110010
00101010
11001101
11111111
00101010
00011000
00000011
11001101
11111100
00011111
11001101
01001110
00100000
11001010
11000001
00100000
11001001
00101010
01100001
01011100
00100010
01011101
01011100
11011111
11111110
11100010
00101000
00001100
00111010
01110001
01011100
11001101
01011001
00011100
11011111
11111110
00001101
11001000
11001111
00001011
11001101
00110000
00100101
11001000
11001111
00010000
00101010
01010001
01011100
00100011
00100011
00100011
00100011
01111110
11111110
01001011
11001001
11100111
11001101
11110010
00100001
11011000
11011111
11111110
00101100
00101000
11110110
11111110
00111011
00101000
11110010
11000011
10001010
00011100
11111110
11011001
11011000
11111110
11011111
00111111
11011000
11110101
11100111
11110001
11010110
11001001
11110101
11001101
10000010
00011100
11110001
10100111
11001101
11000011
00011111
11110101
11001101
10010100
00011110
01010111
11110001
11010111
01111010
11010111
11001001
11010110
00010001
11001110
00000000
00101000
00011101
11010110
00000010
11001110
00000000
00101000
01010110
11111110
00000001
01111010
00000110
00000001
00100000
00000100
00000111
00000111
00000110
00000100
01001111
01111010
11111110
00000010
00110000
00010110
01111001
00100001
10010001
01011100
00011000
00111000
01111010
00000110
00000111
00111000
00000101
00000111
00000111
00000111
00000110
00111000
01001111
01111010
11111110
00001010
00111000
00000010
11001111
00010011
00100001
10001111
01011100
11111110
00001000
00111000
00001011
01111110
00101000
00000111
10110000
00101111
11100110
00100100
00101000
00000001
01111000
01001111
01111001
11001101
01101100
00100010
00111110
00000111
10111010
10011111
11001101
01101100
00100010
00000111
00000111
11100110
01010000
01000111
00111110
00001000
10111010
10011111
10101110
10100000
10101110
01110111
00100011
01111000
11001001
10011111
01111010
00001111
00000110
10000000
00100000
00000011
00001111
00000110
01000000
01001111
01111010
11111110
00001000
00101000
00000100
11111110
00000010
00110000
10111101
01111001
00100001
10001111
01011100
11001101
01101100
00100010
01111001
00001111
00001111
00001111
00011000
11011000
11001101
10010100
00011110
11111110
00001000
00110000
10101001
11010011
11111110
00000111
00000111
00000111
11001011
01101111
00100000
00000010
11101110
00000111
00110010
01001000
01011100
11001001
00111110
10101111
10010000
11011010
11111001
00100100
01000111
10100111
00011111
00110111
00011111
10100111
00011111
10101000
11100110
11111000
10101000
01100111
01111001
00000111
00000111
00000111
10101000
11100110
11000111
10101000
00000111
00000111
01101111
01111001
11100110
00000111
11001001
11001101
00000111
00100011
11001101
10101010
00100010
01000111
00000100
01111110
00000111
00010000
11111101
11100110
00000001
11000011
00101000
00101101
11001101
00000111
00100011
11001101
11100101
00100010
11000011
01001101
00001101
11101101
01000011
01111101
01011100
11001101
10101010
00100010
01000111
00000100
00111110
11111110
00001111
00010000
11111101
01000111
01111110
11111101
01001110
01010111
11001011
01000001
00100000
00000001
10100000
11001011
01010001
00100000
00000010
10101000
00101111
01110111
11000011
11011011
00001011
11001101
00010100
00100011
01000111
11000101
11001101
00010100
00100011
01011001
11000001
01010001
01001111
11001001
11001101
11010101
00101101
11011010
11111001
00100100
00001110
00000001
11001000
00001110
11111111
11001001
11011111
11111110
00101100
11000010
10001010
00011100
11100111
11001101
10000010
00011100
11001101
11101110
00011011
11101111
00101010
00111101
00111000
01111110
11111110
10000001
00110000
00000101
11101111
00000010
00111000
00011000
10100001
11101111
10100011
00111000
00110110
10000011
11101111
11000101
00000010
00111000
11001101
01111101
00100100
11000101
11101111
00110001
11100001
00000100
00111000
01111110
11111110
10000000
00110000
00001000
11101111
00000010
00000010
00111000
11000001
11000011
11011100
00100010
11101111
11000010
00000001
11000000
00000010
00000011
00000001
11100000
00001111
11000000
00000001
00110001
11100000
00000001
00110001
11100000
10100000
11000001
00000010
00111000
11111101
00110100
01100010
11001101
10010100
00011110
01101111
11100101
11001101
10010100
00011110
11100001
01100111
00100010
01111101
01011100
11000001
11000011
00100000
00100100
11011111
11111110
00101100
00101000
00000110
11001101
11101110
00011011
11000011
01110111
00100100
11100111
11001101
10000010
00011100
11001101
11101110
00011011
11101111
11000101
10100010
00000100
00011111
00110001
00110000
00110000
00000000
00000110
00000010
00111000
11000011
01110111
00100100
11000000
00000010
11000001
00000010
00110001
00101010
11100001
00000001
11100001
00101010
00001111
11100000
00000101
00101010
11100000
00000001
00111101
00111000
01111110
11111110
10000001
00110000
00000111
11101111
00000010
00000010
00111000
11000011
01110111
00100100
11001101
01111101
00100100
11000101
11101111
00000010
11100001
00000001
00000101
11000001
00000010
00000001
00110001
11100001
00000100
11000010
00000010
00000001
00110001
11100001
00000100
11100010
11100101
11100000
00000011
10100010
00000100
00110001
00011111
11000101
00000010
00100000
11000000
00000010
11000010
00000010
11000001
11100101
00000100
11100000
11100010
00000100
00001111
11100001
00000001
11000001
00000010
11100000
00000100
11100010
11100101
00000100
00000011
11000010
00101010
11100001
00101010
00001111
00000010
00111000
00011010
11111110
10000001
11000001
11011010
01110111
00100100
11000101
11101111
00000001
00111000
00111010
01111101
01011100
11001101
00101000
00101101
11101111
11000000
00001111
00000001
00111000
00111010
01111110
01011100
11001101
00101000
00101101
11101111
11000101
00001111
11100000
11100101
00111000
11000001
00000101
00101000
00111100
00011000
00010100
11101111
11100001
00110001
11100011
00000100
11100010
11100100
00000100
00000011
11000001
00000010
11100100
00000100
11100010
11100011
00000100
00001111
11000010
00000010
00111000
11000101
11101111
11000000
00000010
11100001
00001111
00110001
00111000
00111010
01111101
01011100
11001101
00101000
00101101
11101111
00000011
11100000
11100010
00001111
11000000
00000001
11100000
00111000
00111010
01111110
01011100
11001101
00101000
00101101
11101111
00000011
00111000
11001101
10110111
00100100
11000001
00010000
11000110
11101111
00000010
00000010
00000001
00111000
00111010
01111101
01011100
11001101
00101000
00101101
11101111
00000011
00000001
00111000
00111010
01111110
01011100
11001101
00101000
00101101
11101111
00000011
00111000
11001101
10110111
00100100
11000011
01001101
00001101
11101111
00110001
00101000
00110100
00110010
00000000
00000001
00000101
11100101
00000001
00000101
00101010
00111000
11001101
11010101
00101101
00111000
00000110
11100110
11111100
11000110
00000100
00110000
00000010
00111110
11111100
11110101
11001101
00101000
00101101
11101111
11100101
00000001
00000101
00110001
00011111
11000100
00000010
00110001
10100010
00000100
00011111
11000001
00000001
11000000
00000010
00110001
00000100
00110001
00001111
10100001
00000011
00011011
11000011
00000010
00111000
11000001
11001001
11001101
00000111
00100011
01111001
10111000
00110000
00000110
01101001
11010101
10101111
01011111
00011000
00000111
10110001
11001000
01101000
01000001
11010101
00010110
00000000
01100000
01111000
00011111
10000101
00111000
00000011
10111100
00111000
00000111
10010100
01001111
11011001
11000001
11000101
00011000
00000100
01001111
11010101
11011001
11000001
00101010
01111101
01011100
01111000
10000100
01000111
01111001
00111100
10000101
00111000
00001101
00101000
00001101
00111101
01001111
11001101
11100101
00100010
11011001
01111001
00010000
11011001
11010001
11001001
00101000
11110011
11001111
00001010
11011111
00000110
00000000
11000101
01001111
00100001
10010110
00100101
11001101
11011100
00010110
01111001
11010010
10000100
00100110
00000110
00000000
01001110
00001001
11101001
11001101
01110100
00000000
00000011
11111110
00001101
11001010
10001010
00011100
11111110
00100010
00100000
11110011
11001101
01110100
00000000
11111110
00100010
11001001
11100111
11111110
00101000
00100000
00000110
11001101
01111001
00011100
11011111
11111110
00101001
11000010
10001010
00011100
11111101
11001011
00000001
01111110
11001001
11001101
00000111
00100011
00101010
00110110
01011100
00010001
00000000
00000001
00011001
01111001
00001111
00001111
00001111
11100110
11100000
10101000
01011111
01111001
11100110
00011000
11101110
01000000
01010111
00000110
01100000
11000101
11010101
11100101
00011010
10101110
00101000
00000100
00111100
00100000
00011010
00111101
01001111
00000110
00000111
00010100
00100011
00011010
10101110
10101001
00100000
00001111
00010000
11110111
11000001
11000001
11000001
00111110
10000000
10010000
00000001
00000001
00000000
11110111
00010010
00011000
00001010
11100001
00010001
00001000
00000000
00011001
11010001
11000001
00010000
11010011
01001000
11000011
10110010
00101010
11001101
00000111
00100011
01111001
00001111
00001111
00001111
01001111
11100110
11100000
10101000
01101111
01111001
11100110
00000011
11101110
01011000
01100111
01111110
11000011
00101000
00101101
00100010
00011100
00101000
01001111
00101110
11110010
00101011
00010010
10101000
01010110
10100101
01010111
10100111
10000100
10100110
10001111
11000100
11100110
10101010
10111111
10101011
11000111
10101001
11001110
00000000
11100111
11000011
11111111
00100100
11011111
00100011
11100101
00000001
00000000
00000000
11001101
00001111
00100101
00100000
00011011
11001101
00001111
00100101
00101000
11111011
11001101
00110000
00100101
00101000
00010001
11110111
11100001
11010101
01111110
00100011
00010010
00010011
11111110
00100010
00100000
11111000
01111110
00100011
11111110
00100010
00101000
11110010
00001011
11010001
00100001
00111011
01011100
11001011
10110110
11001011
01111110
11000100
10110010
00101010
11000011
00010010
00100111
11100111
11001101
11111011
00100100
11111110
00101001
11000010
10001010
00011100
11100111
11000011
00010010
00100111
11000011
10111101
00100111
11001101
00110000
00100101
00101000
00101000
11101101
01001011
01110110
01011100
11001101
00101011
00101101
11101111
10100001
00001111
00110100
00110111
00010110
00000100
00110100
10000000
01000001
00000000
00000000
10000000
00110010
00000010
10100001
00000011
00110001
00111000
11001101
10100010
00101101
11101101
01000011
01110110
01011100
01111110
10100111
00101000
00000011
11010110
00010000
01110111
00011000
00001001
11001101
00110000
00100101
00101000
00000100
11101111
10100011
00111000
00110100
11100111
11000011
11000011
00100110
00000001
01011010
00010000
11100111
11111110
00100011
11001010
00001101
00100111
00100001
00111011
01011100
11001011
10110110
11001011
01111110
00101000
00011111
11001101
10001110
00000010
00001110
00000000
00100000
00010011
11001101
00011110
00000011
00110000
00001110
00010101
01011111
11001101
00110011
00000011
11110101
00000001
00000001
00000000
11110111
11110001
00010010
00001110
00000001
00000110
00000000
11001101
10110010
00101010
11000011
00010010
00100111
11001101
00100010
00100101
11000100
00110101
00100101
11100111
11000011
11011011
00100101
11001101
00100010
00100101
11000100
10000000
00100101
11100111
00011000
01001000
11001101
00100010
00100101
11000100
11001011
00100010
11100111
00011000
00111111
11001101
10001000
00101100
00110000
01010110
11111110
01000001
00110000
00111100
11001101
00110000
00100101
00100000
00100011
11001101
10011011
00101100
11011111
00000001
00000110
00000000
11001101
01010101
00010110
00100011
00110110
00001110
00100011
11101011
00101010
01100101
01011100
00001110
00000101
10100111
11101101
01000010
00100010
01100101
01011100
11101101
10110000
11101011
00101011
11001101
01110111
00000000
00011000
00001110
11011111
00100011
01111110
11111110
00001110
00100000
11111010
00100011
11001101
10110100
00110011
00100010
01011101
01011100
11111101
11001011
00000001
11110110
00011000
00010100
11001101
10110010
00101000
11011010
00101110
00011100
11001100
10010110
00101001
00111010
00111011
01011100
11111110
11000000
00111000
00000100
00100011
11001101
10110100
00110011
00011000
00110011
00000001
11011011
00001001
11111110
00101101
00101000
00100111
00000001
00011000
00010000
11111110
10101110
00101000
00100000
11010110
10101111
11011010
10001010
00011100
00000001
11110000
00000100
11111110
00010100
00101000
00010100
11010010
10001010
00011100
00000110
00010000
11000110
11011100
01001111
11111110
11011111
00110000
00000010
11001011
10110001
11111110
11101110
00111000
00000010
11001011
10111001
11000101
11100111
11000011
11111111
00100100
11011111
11111110
00101000
00100000
00001100
11111101
11001011
00000001
01110110
00100000
00010111
11001101
01010010
00101010
11100111
00011000
11110000
00000110
00000000
01001111
00100001
10010101
00100111
11001101
11011100
00010110
00110000
00000110
01001110
00100001
11101101
00100110
00001001
01000110
11010001
01111010
10111000
00111000
00111010
10100111
11001010
00011000
00000000
11000101
00100001
00111011
01011100
01111011
11111110
11101101
00100000
00000110
11001011
01110110
00100000
00000010
00011110
10011001
11010101
11001101
00110000
00100101
00101000
00001001
01111011
11100110
00111111
01000111
11101111
00111011
00111000
00011000
00001001
01111011
11111101
10101110
00000001
11100110
01000000
11000010
10001010
00011100
11010001
00100001
00111011
01011100
11001011
11110110
11001011
01111011
00100000
00000010
11001011
10110110
11000001
00011000
11000001
11010101
01111001
11111101
11001011
00000001
01110110
00100000
00010101
11100110
00111111
11000110
00001000
01001111
11111110
00010000
00100000
00000100
11001011
11110001
00011000
00001000
00111000
11010111
11111110
00010111
00101000
00000010
11001011
11111001
11000101
11100111
11000011
11111111
00100100
00101011
11001111
00101101
11000011
00101010
11000100
00101111
11000101
01011110
11000110
00111101
11001110
00111110
11001100
00111100
11001101
11000111
11001001
11001000
11001010
11001001
11001011
11000101
11000111
11000110
11001000
00000000
00000110
00001000
00001000
00001010
00000010
00000011
00000101
00000101
00000101
00000101
00000101
00000101
00000110
11001101
00110000
00100101
00100000
00110101
11100111
11001101
10001101
00101100
11010010
10001010
00011100
11100111
11111110
00100100
11110101
00100000
00000001
11100111
11111110
00101000
00100000
00010010
11100111
11111110
00101001
00101000
00010000
11001101
11111011
00100100
11011111
11111110
00101100
00100000
00000011
11100111
00011000
11110101
11111110
00101001
11000010
10001010
00011100
11100111
00100001
00111011
01011100
11001011
10110110
11110001
00101000
00000010
11001011
11110110
11000011
00010010
00100111
11100111
11100110
11011111
01000111
11100111
11010110
00100100
01001111
00100000
00000001
11100111
11100111
11100101
00101010
01010011
01011100
00101011
00010001
11001110
00000000
11000101
11001101
10000110
00011101
11000001
00110000
00000010
11001111
00011000
11100101
11001101
10101011
00101000
11100110
11011111
10111000
00100000
00001000
11001101
10101011
00101000
11010110
00100100
10111001
00101000
00001100
11100001
00101011
00010001
00000000
00000010
11000101
11001101
10001011
00011001
11000001
00011000
11010111
10100111
11001100
10101011
00101000
11010001
11010001
11101101
01010011
01011101
01011100
11001101
10101011
00101000
11100101
11111110
00101001
00101000
01000010
00100011
01111110
11111110
00001110
00010110
01000000
00101000
00000111
00101011
11001101
10101011
00101000
00100011
00010110
00000000
00100011
11100101
11010101
11001101
11111011
00100100
11110001
11111101
10101110
00000001
11100110
01000000
00100000
00101011
11100001
11101011
00101010
01100101
01011100
00000001
00000101
00000000
11101101
01000010
00100010
01100101
01011100
11101101
10110000
11101011
00101011
11001101
10101011
00101000
11111110
00101001
00101000
00001101
11100101
11011111
11111110
00101100
00100000
00001101
11100111
11100001
11001101
10101011
00101000
00011000
10111110
11100101
11011111
11111110
00101001
00101000
00000010
11001111
00011001
11010001
11101011
00100010
01011101
01011100
00101010
00001011
01011100
11100011
00100010
00001011
01011100
11010101
11100111
11100111
11001101
11111011
00100100
11100001
00100010
01011101
01011100
11100001
00100010
00001011
01011100
11100111
11000011
00010010
00100111
00100011
01111110
11111110
00100001
00111000
11111010
11001001
11111101
11001011
00000001
11110110
11011111
11001101
10001101
00101100
11010010
10001010
00011100
11100101
11100110
00011111
01001111
11100111
11100101
11111110
00101000
00101000
00101000
11001011
11110001
11111110
00100100
00101000
00010001
11001011
11101001
11001101
10001000
00101100
00110000
00001111
11001101
10001000
00101100
00110000
00010110
11001011
10110001
11100111
00011000
11110110
11100111
11111101
11001011
00000001
10110110
00111010
00001100
01011100
10100111
00101000
00000110
11001101
00110000
00100101
11000010
01010001
00101001
01000001
11001101
00110000
00100101
00100000
00001000
01111001
11100110
11100000
11001011
11111111
01001111
00011000
00110111
00101010
01001011
01011100
01111110
11100110
01111111
00101000
00101101
10111001
00100000
00100010
00010111
10000111
11110010
00111111
00101001
00111000
00110000
11010001
11010101
11100101
00100011
00011010
00010011
11111110
00100000
00101000
11111010
11110110
00100000
10111110
00101000
11110100
11110110
10000000
10111110
00100000
00000110
00011010
11001101
10001000
00101100
00110000
00010101
11100001
11000101
11001101
10111000
00011001
11101011
11000001
00011000
11001110
11001011
11111000
11010001
11011111
11111110
00101000
00101000
00001001
11001011
11101000
00011000
00001101
11010001
11010001
11010001
11100101
11011111
11001101
10001000
00101100
00110000
00000011
11100111
00011000
11111000
11100001
11001011
00010000
11001011
01110000
11001001
00101010
00001011
01011100
01111110
11111110
00101001
11001010
11101111
00101000
01111110
11110110
01100000
01000111
00100011
01111110
11111110
00001110
00101000
00000111
00101011
11001101
10101011
00101000
00100011
11001011
10101000
01111000
10111001
00101000
00010010
00100011
00100011
00100011
00100011
00100011
11001101
10101011
00101000
11111110
00101001
11001010
11101111
00101000
11001101
10101011
00101000
00011000
11011001
11001011
01101001
00100000
00001100
00100011
11101101
01011011
01100101
01011100
11001101
11000000
00110011
11101011
00100010
01100101
01011100
11010001
11010001
10101111
00111100
11001001
10101111
01000111
11001011
01111001
00100000
01001011
11001011
01111110
00100000
00001110
00111100
00100011
01001110
00100011
01000110
00100011
11101011
11001101
10110010
00101010
11011111
11000011
01001001
00101010
00100011
00100011
00100011
01000110
11001011
01110001
00101000
00001010
00000101
00101000
11101000
11101011
11011111
11111110
00101000
00100000
01100001
11101011
11101011
00011000
00100100
11100101
11011111
11100001
11111110
00101100
00101000
00100000
11001011
01111001
00101000
01010010
11001011
01110001
00100000
00000110
11111110
00101001
00100000
00111100
11100111
11001001
11111110
00101001
00101000
01101100
11111110
11001100
00100000
00110010
11011111
00101011
00100010
01011101
01011100
00011000
01011110
00100001
00000000
00000000
11100101
11100111
11100001
01111001
11111110
11000000
00100000
00001001
11011111
11111110
00101001
00101000
01010001
11111110
11001100
00101000
11100101
11000101
11100101
11001101
11101110
00101010
11100011
11101011
11001101
11001100
00101010
00111000
00011001
00001011
11001101
11110100
00101010
00001001
11010001
11000001
00010000
10110011
11001011
01111001
00100000
01100110
11100101
11001011
01110001
00100000
00010011
01000010
01001011
11011111
11111110
00101001
00101000
00000010
11001111
00000010
11100111
11100001
00010001
00000101
00000000
11001101
11110100
00101010
00001001
11001001
11001101
11101110
00101010
11100011
11001101
11110100
00101010
11000001
00001001
00100011
01000010
01001011
11101011
11001101
10110001
00101010
11011111
11111110
00101001
00101000
00000111
11111110
00101100
00100000
11011011
11001101
01010010
00101010
11100111
11111110
00101000
00101000
11111000
11111101
11001011
00000001
10110110
11001001
11001101
00110000
00100101
11000100
11110001
00101011
11100111
11111110
00101001
00101000
01010000
11010101
10101111
11110101
11000101
00010001
00000001
00000000
11011111
11100001
11111110
11001100
00101000
00010111
11110001
11001101
11001101
00101010
11110101
01010000
01011001
11100101
11011111
11100001
11111110
11001100
00101000
00001001
11111110
00101001
11000010
10001010
00011100
01100010
01101011
00011000
00010011
11100101
11100111
11100001
11111110
00101001
00101000
00001100
11110001
11001101
11001101
00101010
11110101
11011111
01100000
01101001
11111110
00101001
00100000
11100110
11110001
11100011
00011001
00101011
11100011
10100111
11101101
01010010
00000001
00000000
00000000
00111000
00000111
00100011
10100111
11111010
00100000
00101010
01000100
01001101
11010001
11111101
11001011
00000001
10110110
11001101
00110000
00100101
11001000
10101111
11111101
11001011
00000001
10110110
11000101
11001101
10101001
00110011
11000001
00101010
01100101
01011100
01110111
00100011
01110011
00100011
01110010
00100011
01110001
00100011
01110000
00100011
00100010
01100101
01011100
11001001
10101111
11010101
11100101
11110101
11001101
10000010
00011100
11110001
11001101
00110000
00100101
00101000
00010010
11110101
11001101
10011001
00011110
11010001
01111000
10110001
00110111
00101000
00000101
11100001
11100101
10100111
11101101
01000010
01111010
11011110
00000000
11100001
11010001
11001001
11101011
00100011
01011110
00100011
01010110
11001001
11001101
00110000
00100101
11001000
11001101
10101001
00110000
11011010
00010101
00011111
11001001
00101010
01001101
01011100
11111101
11001011
00110111
01001110
00101000
01011110
00000001
00000101
00000000
00000011
00100011
01111110
11111110
00100000
00101000
11111010
00110000
00001011
11111110
00010000
00111000
00010001
11111110
00010110
00110000
00001101
00100011
00011000
11101101
11001101
10001000
00101100
00111000
11100111
11111110
00100100
11001010
11000000
00101011
01111001
00101010
01011001
01011100
00101011
11001101
01010101
00010110
00100011
00100011
11101011
11010101
00101010
01001101
01011100
00011011
11010110
00000110
01000111
00101000
00010001
00100011
01111110
11111110
00100001
00111000
11111010
11110110
00100000
00010011
00010010
00010000
11110100
11110110
10000000
00010010
00111110
11000000
00101010
01001101
01011100
10101110
11110110
00100000
11100001
11001101
11101010
00101011
11100101
11101111
00000010
00111000
11100001
00000001
00000101
00000000
10100111
11101101
01000010
00011000
01000000
11111101
11001011
00000001
01110110
00101000
00000110
00010001
00000110
00000000
00011001
00011000
11100111
00101010
01001101
01011100
11101101
01001011
01110010
01011100
11111101
11001011
00110111
01000110
00100000
00110000
01111000
10110001
11001000
11100101
11110111
11010101
11000101
01010100
01011101
00100011
00110110
00100000
11101101
10111000
11100101
11001101
11110001
00101011
11100001
11100011
10100111
11101101
01000010
00001001
00110000
00000010
01000100
01001101
11100011
11101011
01111000
10110001
00101000
00000010
11101101
10110000
11000001
11010001
11100001
11101011
01111000
10110001
11001000
11010101
11101101
10110000
11100001
11001001
00101011
00101011
00101011
01111110
11100101
11000101
11001101
11000110
00101011
11000001
11100001
00000011
00000011
00000011
11000011
11101000
00011001
00111110
11011111
00101010
01001101
01011100
10100110
11110101
11001101
11110001
00101011
11101011
00001001
11000101
00101011
00100010
01001101
01011100
00000011
00000011
00000011
00101010
01011001
01011100
00101011
11001101
01010101
00010110
00101010
01001101
01011100
11000001
11000101
00000011
11101101
10111000
11101011
00100011
11000001
01110000
00101011
01110001
11110001
00101011
01110111
00101010
01011001
01011100
00101011
11001001
00101010
01100101
01011100
00101011
01000110
00101011
01001110
00101011
01010110
00101011
01011110
00101011
01111110
00100010
01100101
01011100
11001001
11001101
10110010
00101000
11000010
10001010
00011100
11001101
00110000
00100101
00100000
00001000
11001011
10110001
11001101
10010110
00101001
11001101
11101110
00011011
00111000
00001000
11000101
11001101
10111000
00011001
11001101
11101000
00011001
11000001
11001011
11111001
00000110
00000000
11000101
00100001
00000001
00000000
11001011
01110001
00100000
00000010
00101110
00000101
11101011
11100111
00100110
11111111
11001101
11001100
00101010
11011010
00100000
00101010
11100001
11000101
00100100
11100101
01100000
01101001
11001101
11110100
00101010
11101011
11011111
11111110
00101100
00101000
11101000
11111110
00101001
00100000
10111011
11100111
11000001
01111001
01101000
00100110
00000000
00100011
00100011
00101001
00011001
11011010
00010101
00011111
11010101
11000101
11100101
01000100
01001101
00101010
01011001
01011100
00101011
11001101
01010101
00010110
00100011
01110111
11000001
00001011
00001011
00001011
00100011
01110001
00100011
01110000
11000001
01111000
00100011
01110111
01100010
01101011
00011011
00110110
00000000
11001011
01110001
00101000
00000010
00110110
00100000
11000001
11101101
10111000
11000001
01110000
00101011
01110001
00101011
00111101
00100000
11111000
11001001
11001101
00011011
00101101
00111111
11011000
11111110
01000001
00111111
11010000
11111110
01011011
11011000
11111110
01100001
00111111
11010000
11111110
01111011
11001001
11111110
11000100
00100000
00011001
00010001
00000000
00000000
11100111
11010110
00110001
11001110
00000000
00100000
00001010
11101011
00111111
11101101
01101010
11011010
10101101
00110001
11101011
00011000
11101111
01000010
01001011
11000011
00101011
00101101
11111110
00101110
00101000
00001111
11001101
00111011
00101101
11111110
00101110
00100000
00101000
11100111
11001101
00011011
00101101
00111000
00100010
00011000
00001010
11100111
11001101
00011011
00101101
11011010
10001010
00011100
11101111
10100000
00111000
11101111
10100001
11000000
00000010
00111000
11011111
11001101
00100010
00101101
00111000
00001011
11101111
11100000
10100100
00000101
11000000
00000100
00001111
00111000
11100111
00011000
11101111
11111110
01000101
00101000
00000011
11111110
01100101
11000000
00000110
11111111
11100111
11111110
00101011
00101000
00000101
11111110
00101101
00100000
00000010
00000100
11100111
11001101
00011011
00101101
00111000
11001011
11000101
11001101
00111011
00101101
11001101
11010101
00101101
11000001
11011010
10101101
00110001
10100111
11111010
10101101
00110001
00000100
00101000
00000010
11101101
01000100
11000011
01001111
00101101
11111110
00110000
11011000
11111110
00111010
00111111
11001001
11001101
00011011
00101101
11011000
11010110
00110000
01001111
00000110
00000000
11111101
00100001
00111010
01011100
10101111
01011111
01010001
01001000
01000111
11001101
10110110
00101010
11101111
00111000
10100111
11001001
11110101
11101111
10100000
00111000
11110001
11001101
00100010
00101101
11011000
11101111
00000001
10100100
00000100
00001111
00111000
11001101
01110100
00000000
00011000
11110001
00000111
00001111
00110000
00000010
00101111
00111100
11110101
00100001
10010010
01011100
11001101
00001011
00110101
11101111
10100100
00111000
11110001
11001011
00111111
00110000
00001101
11110101
11101111
11000001
11100000
00000000
00000100
00000100
00110011
00000010
00000101
11100001
00111000
11110001
00101000
00001000
11110101
11101111
00110001
00000100
00111000
11110001
00011000
11100101
11101111
00000010
00111000
11001001
00100011
01001110
00100011
01111110
10101001
10010001
01011111
00100011
01111110
10001001
10101001
01010111
11001001
00001110
00000000
11100101
00110110
00000000
00100011
01110001
00100011
01111011
10101001
10010001
01110111
00100011
01111010
10001001
10101001
01110111
00100011
00110110
00000000
11100001
11001001
11101111
00111000
01111110
10100111
00101000
00000101
11101111
10100010
00001111
00100111
00111000
11101111
00000010
00111000
11100101
11010101
11101011
01000110
11001101
01111111
00101101
10101111
10010000
11001011
01111001
01000010
01001011
01111011
11010001
11100001
11001001
01010111
00010111
10011111
01011111
01001111
10101111
01000111
11001101
10110110
00101010
11101111
00110100
11101111
00011010
00100000
10011010
10000101
00000100
00100111
00111000
11001101
10100010
00101101
11011000
11110101
00000101
00000100
00101000
00000011
11110001
00110111
11001001
11110001
11001001
11101111
00110001
00110110
00000000
00001011
00110001
00110111
00000000
00001101
00000010
00111000
00111110
00110000
11010111
11001001
00101010
00111000
00111110
00101101
11010111
11101111
10100000
11000011
11000100
11000101
00000010
00111000
11011001
11100101
11011001
11101111
00110001
00100111
11000010
00000011
11100010
00000001
11000010
00000010
00111000
01111110
10100111
00100000
01000111
11001101
01111111
00101101
00000110
00010000
01111010
10100111
00100000
00000110
10110011
00101000
00001001
01010011
00000110
00001000
11010101
11011001
11010001
11011001
00011000
01010111
11101111
11100010
00111000
01111110
11010110
01111110
11001101
11000001
00101101
01010111
00111010
10101100
01011100
10010010
00110010
10101100
01011100
01111010
11001101
01001111
00101101
11101111
00110001
00100111
11000001
00000011
11100001
00111000
11001101
11010101
00101101
11100101
00110010
10100001
01011100
00111101
00010111
10011111
00111100
00100001
10101011
01011100
01110111
00100011
10000110
01110111
11100001
11000011
11001111
00101110
11010110
10000000
11111110
00011100
00111000
00010011
11001101
11000001
00101101
11010110
00000111
01000111
00100001
10101100
01011100
10000110
01110111
01111000
11101101
01000100
11001101
01001111
00101101
00011000
10010010
11101011
11001101
10111010
00101111
11011001
11001011
11111010
01111101
11011001
11010110
10000000
01000111
11001011
00100011
11001011
00010010
11011001
11001011
00010011
11001011
00010010
11011001
00100001
10101010
01011100
00001110
00000101
01111110
10001111
00100111
01110111
00101011
00001101
00100000
11111000
00010000
11100111
10101111
00100001
10100110
01011100
00010001
10100001
01011100
00000110
00001001
11101101
01101111
00001110
11111111
11101101
01101111
00100000
00000100
00001101
00001100
00100000
00001010
00010010
00010011
11111101
00110100
01110001
11111101
00110100
01110010
00001110
00000000
11001011
01000000
00101000
00000001
00100011
00010000
11100111
00111010
10101011
01011100
11010110
00001001
00111000
00001010
11111101
00110101
01110001
00111110
00000100
11111101
10111110
01101111
00011000
01000001
11101111
00000010
11100010
00111000
11101011
11001101
10111010
00101111
11011001
00111110
10000000
10010101
00101110
00000000
11001011
11111010
11011001
11001101
11011101
00101111
11111101
01111110
01110001
11111110
00001000
00111000
00000110
11011001
11001011
00010010
11011001
00011000
00100000
00000001
00000000
00000010
01111011
11001101
10001011
00101111
01011111
01111010
11001101
10001011
00101111
01010111
11000101
11011001
11000001
00010000
11110001
00100001
10100001
01011100
01111001
11111101
01001110
01110001
00001001
01110111
11111101
00110100
01110001
00011000
11010011
11110101
00100001
10100001
01011100
11111101
01001110
01110001
00000110
00000000
00001001
01000001
11110001
00101011
01111110
11001110
00000000
01110111
10100111
00101000
00000101
11111110
00001010
00111111
00110000
00001000
00010000
11110001
00110110
00000001
00000100
11111101
00110100
01110010
11111101
01110000
01110001
11101111
00000010
00111000
11011001
11100001
11011001
11101101
01001011
10101011
01011100
00100001
10100001
01011100
01111000
11111110
00001001
00111000
00000100
11111110
11111100
00111000
00100110
10100111
11001100
11101111
00010101
10101111
10010000
11111010
01010010
00101111
01000111
00011000
00001100
01111001
10100111
00101000
00000011
01111110
00100011
00001101
11001101
11101111
00010101
00010000
11110100
01111001
10100111
11001000
00000100
00111110
00101110
11010111
00111110
00110000
00010000
11111011
01000001
00011000
11100110
01010000
00010101
00000110
00000001
11001101
01001010
00101111
00111110
01000101
11010111
01001010
01111001
10100111
11110010
10000011
00101111
11101101
01000100
01001111
00111110
00101101
00011000
00000010
00111110
00101011
11010111
00000110
00000000
11000011
00011011
00011010
11010101
01101111
00100110
00000000
01011101
01010100
00101001
00101001
00011001
00101001
01011001
00011001
01001100
01111101
11010001
11001001
01111110
00110110
00000000
10100111
11001000
00100011
11001011
01111110
11001011
11111110
00101011
11001000
11000101
00000001
00000101
00000000
00001001
01000001
01001111
00110111
00101011
01111110
00101111
11001110
00000000
01110111
00010000
11111000
01111001
11000001
11001001
11100101
11110101
01001110
00100011
01000110
01110111
00100011
01111001
01001110
11000101
00100011
01001110
00100011
01000110
11101011
01010111
01011110
11010101
00100011
01010110
00100011
01011110
11010101
11011001
11010001
11100001
11000001
11011001
00100011
01010110
00100011
01011110
11110001
11100001
11001001
10100111
11001000
11111110
00100001
00110000
00010110
11000101
01000111
11011001
11001011
00101101
11001011
00011010
11001011
00011011
11011001
11001011
00011010
11001011
00011011
00010000
11110010
11000001
11010000
11001101
00000100
00110000
11000000
11011001
10101111
00101110
00000000
01010111
01011101
11011001
00010001
00000000
00000000
11001001
00011100
11000000
00010100
11000000
11011001
00011100
00100000
00000001
00010100
11011001
11001001
11101011
11001101
01101110
00110100
11101011
00011010
10110110
00100000
00100110
11010101
00100011
11100101
00100011
01011110
00100011
01010110
00100011
00100011
00100011
01111110
00100011
01001110
00100011
01000110
11100001
11101011
00001001
11101011
10001110
00001111
11001110
00000000
00100000
00001011
10011111
01110111
00100011
01110011
00100011
01110010
00101011
00101011
00101011
11010001
11001001
00101011
11010001
11001101
10010011
00110010
11011001
11100101
11011001
11010101
11100101
11001101
10011011
00101111
01000111
11101011
11001101
10011011
00101111
01001111
10111000
00110000
00000011
01111000
01000001
11101011
11110101
10010000
11001101
10111010
00101111
11001101
11011101
00101111
11110001
11100001
01110111
11100101
01101000
01100001
00011001
11011001
11101011
11101101
01001010
11101011
01111100
10001101
01101111
00011111
10101101
11011001
11101011
11100001
00011111
00110000
00001000
00111110
00000001
11001101
11011101
00101111
00110100
00101000
00100011
11011001
01111101
11100110
10000000
11011001
00100011
01110111
00101011
00101000
00011111
01111011
11101101
01000100
00111111
01011111
01111010
00101111
11001110
00000000
01010111
11011001
01111011
00101111
11001110
00000000
01011111
01111010
00101111
11001110
00000000
00110000
00000111
00011111
11011001
00110100
11001010
10101101
00110001
11011001
01010111
11011001
10101111
11000011
01010101
00110001
11000101
00000110
00010000
01111100
01001101
00100001
00000000
00000000
00101001
00111000
00001010
11001011
00010001
00010111
00110000
00000011
00011001
00111000
00000010
00010000
11110011
11000001
11001001
11001101
11101001
00110100
11011000
00100011
10101110
11001011
11111110
00101011
11001001
00011010
10110110
00100000
00100010
11010101
11100101
11010101
11001101
01111111
00101101
11101011
11100011
01000001
11001101
01111111
00101101
01111000
10101001
01001111
11100001
11001101
10101001
00110000
11101011
11100001
00111000
00001010
01111010
10110011
00100000
00000001
01001111
11001101
10001110
00101101
11010001
11001001
11010001
11001101
10010011
00110010
10101111
11001101
11000000
00110000
11011000
11011001
11100101
11011001
11010101
11101011
11001101
11000000
00110000
11101011
00111000
01011010
11100101
11001101
10111010
00101111
01111000
10100111
11101101
01100010
11011001
11100101
11101101
01100010
11011001
00000110
00100001
00011000
00010001
00110000
00000101
00011001
11011001
11101101
01011010
11011001
11011001
11001011
00011100
11001011
00011101
11011001
11001011
00011100
11001011
00011101
11011001
11001011
00011000
11001011
00011001
11011001
11001011
00011001
00011111
00010000
11100100
11101011
11011001
11101011
11011001
11000001
11100001
01111000
10000001
00100000
00000001
10100111
00111101
00111111
00010111
00111111
00011111
11110010
01000110
00110001
00110000
01101000
10100111
00111100
00100000
00001000
00111000
00000110
11011001
11001011
01111010
11011001
00100000
01011100
01110111
11011001
01111000
11011001
00110000
00010101
01111110
10100111
00111110
10000000
00101000
00000001
10101111
11011001
10100010
11001101
11111011
00101111
00000111
01110111
00111000
00101110
00100011
01110111
00101011
00011000
00101001
00000110
00100000
11011001
11001011
01111010
11011001
00100000
00010010
00000111
11001011
00010011
11001011
00010010
11011001
11001011
00010011
11001011
00010010
11011001
00110101
00101000
11010111
00010000
11101010
00011000
11010111
00010111
00110000
00001100
11001101
00000100
00110000
00100000
00000111
11011001
00010110
10000000
11011001
00110100
00101000
00011000
11100101
00100011
11011001
11010101
11011001
11000001
01111000
00010111
11001011
00010110
00011111
01110111
00100011
01110001
00100011
01110010
00100011
01110011
11100001
11010001
11011001
11100001
11011001
11001001
11001111
00000101
11001101
10010011
00110010
11101011
10101111
11001101
11000000
00110000
00111000
11110100
11101011
11001101
11000000
00110000
11011000
11011001
11100101
11011001
11010101
11100101
11001101
10111010
00101111
11011001
11100101
01100000
01101001
11011001
01100001
01101000
10101111
00000110
11011111
00011000
00010000
00010111
11001011
00010001
11011001
11001011
00010001
11001011
00010000
11011001
00101001
11011001
11101101
01101010
11011001
00111000
00010000
11101101
01010010
11011001
11101101
01010010
11011001
00110000
00001111
00011001
11011001
11101101
01011010
11011001
10100111
00011000
00001000
10100111
11101101
01010010
11011001
11101101
01010010
11011001
00110111
00000100
11111010
11010010
00110001
11110101
00101000
11100001
01011111
01010001
11011001
01011001
01010000
11110001
11001011
00011000
11110001
11001011
00011000
11011001
11000001
11100001
01111000
10010001
11000011
00111101
00110001
01111110
10100111
11001000
11111110
10000001
00110000
00000110
00110110
00000000
00111110
00100000
00011000
01010001
11111110
10010001
00100000
00011010
00100011
00100011
00100011
00111110
10000000
10100110
00101011
10110110
00101011
00100000
00000011
00111110
10000000
10101110
00101011
00100000
00110110
01110111
00100011
00110110
11111111
00101011
00111110
00011000
00011000
00110011
00110000
00101100
11010101
00101111
11000110
10010001
00100011
01010110
00100011
01011110
00101011
00101011
00001110
00000000
11001011
01111010
00101000
00000001
00001101
11001011
11111010
00000110
00001000
10010000
10000000
00111000
00000100
01011010
00010110
00000000
10010000
00101000
00000111
01000111
11001011
00111010
11001011
00011011
00010000
11111010
11001101
10001110
00101101
11010001
11001001
01111110
11010110
10100000
11110000
11101101
01000100
11010101
11101011
00101011
01000111
11001011
00111000
11001011
00111000
11001011
00111000
00101000
00000101
00110110
00000000
00101011
00010000
11111011
11100110
00000111
00101000
00001001
01000111
00111110
11111111
11001011
00100111
00010000
11111100
10100110
01110111
11101011
11010001
11001001
11001101
10010110
00110010
11101011
01111110
10100111
11000000
11010101
11001101
01111111
00101101
10101111
00100011
01110111
00101011
01110111
00000110
10010001
01111010
10100111
00100000
00001000
10110011
01000010
00101000
00010000
01010011
01011000
00000110
10001001
11101011
00000101
00101001
00110000
11111100
11001011
00001001
11001011
00011100
11001011
00011101
11101011
00101011
01110011
00101011
01110010
00101011
01110000
11010001
11001001
00000000
10110000
00000000
01000000
10110000
00000000
00000001
00110000
00000000
11110001
01001001
00001111
11011010
10100010
01000000
10110000
00000000
00001010
10001111
00110110
00111100
00110100
10100001
00110011
00001111
00110000
11001010
00110000
10101111
00110001
01010001
00111000
00011011
00110101
00100100
00110101
00111011
00110101
00111011
00110101
00111011
00110101
00111011
00110101
00111011
00110101
00111011
00110101
00010100
00110000
00101101
00110101
00111011
00110101
00111011
00110101
00111011
00110101
00111011
00110101
00111011
00110101
00111011
00110101
10011100
00110101
11011110
00110101
10111100
00110100
01000101
00110110
01101110
00110100
01101001
00110110
11011110
00110101
01110100
00110110
10110101
00110111
10101010
00110111
11011010
00110111
00110011
00111000
01000011
00111000
11100010
00110111
00010011
00110111
11000100
00110110
10101111
00110110
01001010
00111000
10010010
00110100
01101010
00110100
10101100
00110100
10100101
00110100
10110011
00110100
00011111
00110110
11001001
00110101
00000001
00110101
11000000
00110011
10100000
00110110
10000110
00110110
11000110
00110011
01111010
00110110
00000110
00110101
11111001
00110100
10011011
00110110
10000011
00110111
00010100
00110010
10100010
00110011
01001111
00101101
10010111
00110010
01001001
00110100
00011011
00110100
00101101
00110100
00001111
00110100
11001101
10111111
00110101
01111000
00110010
01100111
01011100
11011001
11100011
11011001
11101101
01010011
01100101
01011100
11011001
01111110
00100011
11100101
10100111
11110010
10000000
00110011
01010111
11100110
01100000
00001111
00001111
00001111
00001111
11000110
01111100
01101111
01111010
11100110
00011111
00011000
00001110
11111110
00011000
00110000
00001000
11011001
00000001
11111011
11111111
01010100
01011101
00001001
11011001
00000111
01101111
00010001
11010111
00110010
00100110
00000000
00011001
01011110
00100011
01010110
00100001
01100101
00110011
11100011
11010101
11011001
11101101
01001011
01100110
01011100
11001001
11110001
00111010
01100111
01011100
11011001
00011000
11000011
11010101
11100101
00000001
00000101
00000000
11001101
00000101
00011111
11100001
11010001
11001001
11101101
01011011
01100101
01011100
11001101
11000000
00110011
11101101
01010011
01100101
01011100
11001001
11001101
10101001
00110011
11101101
10110000
11001001
01100010
01101011
11001101
10101001
00110011
11011001
11100101
11011001
11100011
11000101
01111110
11100110
11000000
00000111
00000111
01001111
00001100
01111110
11100110
00111111
00100000
00000010
00100011
01111110
11000110
01010000
00010010
00111110
00000101
10010001
00100011
00010011
00000110
00000000
11101101
10110000
11000001
11100011
11011001
11100001
11011001
01000111
10101111
00000101
11001000
00010010
00010011
00011000
11111010
10100111
11001000
11110101
11010101
00010001
00000000
00000000
11001101
11001000
00110011
11010001
11110001
00111101
00011000
11110010
01001111
00000111
00000111
10000001
01001111
00000110
00000000
00001001
11001001
11010101
00101010
01101000
01011100
11001101
00000110
00110100
11001101
11000000
00110011
11100001
11001001
01100010
01101011
11011001
11100101
00100001
11000101
00110010
11011001
11001101
11110111
00110011
11001101
11001000
00110011
11011001
11100001
11011001
11001001
11100101
11101011
00101010
01101000
01011100
11001101
00000110
00110100
11101011
11001101
11000000
00110011
11101011
11100001
11001001
00000110
00000101
00011010
01001110
11101011
00010010
01110001
00100011
00010011
00010000
11110111
11101011
11001001
01000111
11001101
01011110
00110011
00110001
00001111
11000000
00000010
10100000
11000010
00110001
11100000
00000100
11100010
11000001
00000011
00111000
11001101
11000110
00110011
11001101
01100010
00110011
00001111
00000001
11000010
00000010
00110101
11101110
11100001
00000011
00111000
11001001
00000110
11111111
00011000
00000110
11001101
11101001
00110100
11011000
00000110
00000000
01111110
10100111
00101000
00001011
00100011
01111000
11100110
10000000
10110110
00010111
00111111
00011111
01110111
00101011
11001001
11010101
11100101
11001101
01111111
00101101
11100001
01111000
10110001
00101111
01001111
11001101
10001110
00101101
11010001
11001001
11001101
11101001
00110100
11011000
11010101
00010001
00000001
00000000
00100011
11001011
00010110
00101011
10011111
01001111
11001101
10001110
00101101
11010001
11001001
11001101
10011001
00011110
11101101
01111000
00011000
00000100
11001101
10011001
00011110
00001010
11000011
00101000
00101101
11001101
10011001
00011110
00100001
00101011
00101101
11100101
11000101
11001001
11001101
11110001
00101011
00001011
01111000
10110001
00100000
00100011
00011010
11001101
10001101
00101100
00111000
00001001
11010110
10010000
00111000
00011001
11111110
00010101
00110000
00010101
00111100
00111101
10000111
10000111
10000111
11111110
10101000
00110000
00001100
11101101
01001011
01111011
01011100
10000001
01001111
00110000
00000001
00000100
11000011
00101011
00101101
11001111
00001001
11100101
11000101
01000111
01111110
00100011
10110110
00100011
10110110
00100011
10110110
01111000
11000001
11100001
11000000
00110111
11001001
11001101
11101001
00110100
11011000
00111110
11111111
00011000
00000110
11001101
11101001
00110100
00011000
00000101
10101111
00100011
10101110
00101011
00000111
11100101
00111110
00000000
01110111
00100011
01110111
00100011
00010111
01110111
00011111
00100011
01110111
00100011
01110111
11100001
11001001
11101011
11001101
11101001
00110100
11101011
11011000
00110111
00011000
11100111
11101011
11001101
11101001
00110100
11101011
11010000
10100111
00011000
11011110
11101011
11001101
11101001
00110100
11101011
11010000
11010101
00011011
10101111
00010010
00011011
00010010
11010001
11001001
01111000
11010110
00001000
11001011
01010111
00100000
00000001
00111101
00001111
00110000
00001000
11110101
11100101
11001101
00111100
00110100
11010001
11101011
11110001
11001011
01010111
00100000
00000111
00001111
11110101
11001101
00001111
00110000
00011000
00110011
00001111
11110101
11001101
11110001
00101011
11010101
11000101
11001101
11110001
00101011
11100001
01111100
10110101
11100011
01111000
00100000
00001011
10110001
11000001
00101000
00000100
11110001
00111111
00011000
00010110
11110001
00011000
00010011
10110001
00101000
00001101
00011010
10010110
00111000
00001001
00100000
11101101
00001011
00010011
00100011
11100011
00101011
00011000
11011111
11000001
11110001
10100111
11110101
11101111
10100000
00111000
11110001
11110101
11011100
00000001
00110101
11110001
11110101
11010100
11111001
00110100
11110001
00001111
11010100
00000001
00110101
11001001
11001101
11110001
00101011
11010101
11000101
11001101
11110001
00101011
11100001
11100101
11010101
11000101
00001001
01000100
01001101
11110111
11001101
10110010
00101010
11000001
11100001
01111000
10110001
00101000
00000010
11101101
10110000
11000001
11100001
01111000
10110001
00101000
00000010
11101101
10110000
00101010
01100101
01011100
00010001
11111011
11111111
11100101
00011001
11010001
11001001
11001101
11010101
00101101
00111000
00001110
00100000
00001100
11110101
00000001
00000001
00000000
11110111
11110001
00010010
11001101
10110010
00101010
11101011
11001001
11001111
00001010
00101010
01011101
01011100
11100101
01111000
11000110
11100011
10011111
11110101
11001101
11110001
00101011
11010101
00000011
11110111
11100001
11101101
01010011
01011101
01011100
11010101
11101101
10110000
11101011
00101011
00110110
00001101
11111101
11001011
00000001
10111110
11001101
11111011
00100100
11011111
11111110
00001101
00100000
00000111
11100001
11110001
11111101
10101110
00000001
11100110
01000000
11000010
10001010
00011100
00100010
01011101
01011100
11111101
11001011
00000001
11111110
11001101
11111011
00100100
11100001
00100010
01011101
01011100
00011000
10100000
00000001
00000001
00000000
11110111
00100010
01011011
01011100
11100101
00101010
01010001
01011100
11100101
00111110
11111111
11001101
00000001
00010110
11001101
11100011
00101101
11100001
11001101
00010101
00010110
11010001
00101010
01011011
01011100
10100111
11101101
01010010
01000100
01001101
11001101
10110010
00101010
11101011
11001001
11001101
10010100
00011110
11111110
00010000
11010010
10011111
00011110
00101010
01010001
01011100
11100101
11001101
00000001
00010110
11001101
11100110
00010101
00000001
00000000
00000000
00110000
00000011
00001100
11110111
00010010
11001101
10110010
00101010
11100001
11001101
00010101
00010110
11000011
10111111
00110101
11001101
11110001
00101011
01111000
10110001
00101000
00000001
00011010
11000011
00101000
00101101
11001101
11110001
00101011
11000011
00101011
00101101
11011001
11100101
00100001
01100111
01011100
00110101
11100001
00100000
00000100
00100011
11011001
11001001
11011001
01011110
01111011
00010111
10011111
01010111
00011001
11011001
11001001
00010011
00010011
00011010
00011011
00011011
10100111
00100000
11101111
11011001
00100011
11011001
11001001
11110001
11011001
11100011
11011001
11001001
11101111
11000000
00000010
00110001
11100000
00000101
00100111
11100000
00000001
11000000
00000100
00000011
11100000
00111000
11001001
11101111
00110001
00110110
00000000
00000100
00111010
00111000
11001001
00110001
00111010
11000000
00000011
11100000
00000001
00110000
00000000
00000011
10100001
00000011
00111000
11001001
11101111
00111101
00110100
11110001
00111000
10101010
00111011
00101001
00000100
00110001
00100111
11000011
00000011
00110001
00001111
10100001
00000011
10001000
00010011
00110110
01011000
01100101
01100110
10011101
01111000
01100101
01000000
10100010
01100000
00110010
11001001
11100111
00100001
11110111
10101111
00100100
11101011
00101111
10110000
10110000
00010100
11101110
01111110
10111011
10010100
01011000
11110001
00111010
01111110
11111000
11001111
11100011
00111000
11001101
11010101
00101101
00100000
00000111
00111000
00000011
10000110
00110000
00001001
11001111
00000101
00111000
00000111
10010110
00110000
00000100
11101101
01000100
01110111
11001001
11101111
00000010
10100000
00111000
11001001
11101111
00111101
00110001
00110111
00000000
00000100
00111000
11001111
00001001
10100000
00000010
00111000
01111110
00110110
10000000
11001101
00101000
00101101
11101111
00110100
00111000
00000000
00000011
00000001
00110001
00110100
11110000
01001100
11001100
11001100
11001101
00000011
00110111
00000000
00001000
00000001
10100001
00000011
00000001
00111000
00110100
11101111
00000001
00110100
11110000
00110001
01110010
00010111
11111000
00000100
00000001
10100010
00000011
10100010
00000011
00110001
00110100
00110010
00100000
00000100
10100010
00000011
10001100
00010001
10101100
00010100
00001001
01010110
11011010
10100101
01011001
00110000
11000101
01011100
10010000
10101010
10011110
01110000
01101111
01100001
10100001
11001011
11011010
10010110
10100100
00110001
10011111
10110100
11100111
10100000
11111110
01011100
11111100
11101010
00011011
01000011
11001010
00110110
11101101
10100111
10011100
01111110
01011110
11110000
01101110
00100011
10000000
10010011
00000100
00001111
00111000
11001001
11101111
00111101
00110100
11101110
00100010
11111001
10000011
01101110
00000100
00110001
10100010
00001111
00100111
00000011
00110001
00001111
00110001
00001111
00110001
00101010
10100001
00000011
00110001
00110111
11000000
00000000
00000100
00000010
00111000
11001001
10100001
00000011
00000001
00110110
00000000
00000010
00011011
00111000
11001001
11101111
00111001
00101010
10100001
00000011
11100000
00000000
00000110
00011011
00110011
00000011
11101111
00111001
00110001
00110001
00000100
00110001
00001111
10100001
00000011
10000110
00010100
11100110
01011100
00011111
00001011
10100011
10001111
00111000
11101110
11101001
00010101
01100011
10111011
00100011
11101110
10010010
00001101
11001101
11101101
11110001
00100011
01011101
00011011
11101010
00000100
00111000
11001001
11101111
00110001
00011111
00000001
00100000
00000101
00111000
11001001
11001101
10010111
00110010
01111110
11111110
10000001
00111000
00001110
11101111
10100001
00011011
00000001
00000101
00110001
00110110
10100011
00000001
00000000
00000110
00011011
00110011
00000011
11101111
10100000
00000001
00110001
00110001
00000100
00110001
00001111
10100001
00000011
10001100
00010000
10110010
00010011
00001110
01010101
11100100
10001101
01011000
00111001
10111100
01011011
10011000
11111101
10011110
00000000
00110110
01110101
10100000
11011011
11101000
10110100
01100011
01000010
11000100
11100110
10110101
00001001
00110110
10111110
11101001
00110110
01110011
00011011
01011101
11101100
11011000
11011110
01100011
10111110
11110000
01100001
10100001
10110011
00001100
00000100
00001111
00111000
11001001
11101111
00110001
00110001
00000100
10100001
00000011
00011011
00101000
10100001
00001111
00000101
00100100
00110001
00001111
00111000
11001001
11101111
00100010
10100011
00000011
00011011
00111000
11001001
11101111
00110001
00110000
00000000
00011110
10100010
00111000
11101111
00000001
00110001
00110000
00000000
00000111
00100101
00000100
00111000
11000011
11000100
00110110
00000010
00110001
00110000
00000000
00001001
10100000
00000001
00110111
00000000
00000110
10100001
00000001
00000101
00000010
10100001
00111000
11001001
11111111
11111111
11111111
11111111
11111111
11111111
11111111
11111111
11111111
11111111
11111111
11111111
11111111
11111111
11111111
11111111
11111111
11111111
11111111
11111111
11111111
11111111
11111111
11111111
11111111
11111111
11111111
11111111
11111111
11111111
11111111
11111111
11111111
11111111
11111111
11111111
11111111
11111111
11111111
11111111
11111111
11111111
11111111
11111111
11111111
11111111
11111111
11111111
11111111
11111111
11111111
11111111
11111111
11111111
11111111
11111111
11111111
11111111
11111111
11111111
11111111
11111111
11111111
11111111
11111111
11111111
11111111
11111111
11111111
11111111
11111111
11111111
11111111
11111111
11111111
11111111
11111111
11111111
11111111
11111111
11111111
11111111
11111111
11111111
11111111
11111111
11111111
11111111
11111111
11111111
11111111
11111111
11111111
11111111
11111111
11111111
11111111
11111111
11111111
11111111
11111111
11111111
11111111
11111111
11111111
11111111
11111111
11111111
11111111
11111111
11111111
11111111
11111111
11111111
11111111
11111111
11111111
11111111
11111111
11111111
11111111
11111111
11111111
11111111
11111111
11111111
11111111
11111111
11111111
11111111
11111111
11111111
11111111
11111111
11111111
11111111
11111111
11111111
11111111
11111111
11111111
11111111
11111111
11111111
11111111
11111111
11111111
11111111
11111111
11111111
11111111
11111111
11111111
11111111
11111111
11111111
11111111
11111111
11111111
11111111
11111111
11111111
11111111
11111111
11111111
11111111
11111111
11111111
11111111
11111111
11111111
11111111
11111111
11111111
11111111
11111111
11111111
11111111
11111111
11111111
11111111
11111111
11111111
11111111
11111111
11111111
11111111
11111111
11111111
11111111
11111111
11111111
11111111
11111111
11111111
11111111
11111111
11111111
11111111
11111111
11111111
11111111
11111111
11111111
11111111
11111111
11111111
11111111
11111111
11111111
11111111
11111111
11111111
11111111
11111111
11111111
11111111
11111111
11111111
11111111
11111111
11111111
11111111
11111111
11111111
11111111
11111111
11111111
11111111
11111111
11111111
11111111
11111111
11111111
11111111
11111111
11111111
11111111
11111111
11111111
11111111
11111111
11111111
11111111
11111111
11111111
11111111
11111111
11111111
11111111
11111111
11111111
11111111
11111111
11111111
11111111
11111111
11111111
11111111
11111111
11111111
11111111
11111111
11111111
11111111
11111111
11111111
11111111
11111111
11111111
11111111
11111111
11111111
11111111
11111111
11111111
11111111
11111111
11111111
11111111
11111111
11111111
11111111
11111111
11111111
11111111
11111111
11111111
11111111
11111111
11111111
11111111
11111111
11111111
11111111
11111111
11111111
11111111
11111111
11111111
11111111
11111111
11111111
11111111
11111111
11111111
11111111
11111111
11111111
11111111
11111111
11111111
11111111
11111111
11111111
11111111
11111111
11111111
11111111
11111111
11111111
11111111
11111111
11111111
11111111
11111111
11111111
11111111
11111111
11111111
11111111
11111111
11111111
11111111
11111111
11111111
11111111
11111111
11111111
11111111
11111111
11111111
11111111
11111111
11111111
11111111
11111111
11111111
11111111
11111111
11111111
11111111
11111111
11111111
11111111
11111111
11111111
11111111
11111111
11111111
11111111
11111111
11111111
11111111
11111111
11111111
11111111
11111111
11111111
11111111
11111111
11111111
11111111
11111111
11111111
11111111
11111111
11111111
11111111
11111111
11111111
11111111
11111111
11111111
11111111
11111111
11111111
11111111
11111111
11111111
11111111
11111111
11111111
11111111
11111111
11111111
11111111
11111111
11111111
11111111
11111111
11111111
11111111
11111111
11111111
11111111
11111111
11111111
11111111
11111111
11111111
11111111
11111111
11111111
11111111
11111111
11111111
11111111
11111111
11111111
11111111
11111111
11111111
11111111
11111111
11111111
11111111
11111111
11111111
11111111
11111111
11111111
11111111
11111111
11111111
11111111
11111111
11111111
11111111
11111111
11111111
11111111
11111111
11111111
11111111
11111111
11111111
11111111
11111111
11111111
11111111
11111111
11111111
11111111
11111111
11111111
11111111
11111111
11111111
11111111
11111111
11111111
11111111
11111111
11111111
11111111
11111111
11111111
11111111
11111111
11111111
11111111
11111111
11111111
11111111
11111111
11111111
11111111
11111111
11111111
11111111
11111111
11111111
11111111
11111111
11111111
11111111
11111111
11111111
11111111
11111111
11111111
11111111
11111111
11111111
11111111
11111111
11111111
11111111
11111111
11111111
11111111
11111111
11111111
11111111
11111111
11111111
11111111
11111111
11111111
11111111
11111111
11111111
11111111
11111111
11111111
11111111
11111111
11111111
11111111
11111111
11111111
11111111
11111111
11111111
11111111
11111111
11111111
11111111
11111111
11111111
11111111
11111111
11111111
11111111
11111111
11111111
11111111
11111111
11111111
11111111
11111111
11111111
11111111
11111111
11111111
11111111
11111111
11111111
11111111
11111111
11111111
11111111
11111111
11111111
11111111
11111111
11111111
11111111
11111111
11111111
11111111
11111111
11111111
11111111
11111111
11111111
11111111
11111111
11111111
11111111
11111111
11111111
11111111
11111111
11111111
11111111
11111111
11111111
11111111
11111111
11111111
11111111
11111111
11111111
11111111
11111111
11111111
11111111
11111111
11111111
11111111
11111111
11111111
11111111
11111111
11111111
11111111
11111111
11111111
11111111
11111111
11111111
11111111
11111111
11111111
11111111
11111111
11111111
11111111
11111111
11111111
11111111
11111111
11111111
11111111
11111111
11111111
11111111
11111111
11111111
11111111
11111111
11111111
11111111
11111111
11111111
11111111
11111111
11111111
11111111
11111111
11111111
11111111
11111111
11111111
11111111
11111111
11111111
11111111
11111111
11111111
11111111
11111111
11111111
11111111
11111111
11111111
11111111
11111111
11111111
11111111
11111111
11111111
11111111
11111111
11111111
11111111
11111111
11111111
11111111
11111111
11111111
11111111
11111111
11111111
11111111
11111111
11111111
11111111
11111111
11111111
11111111
11111111
11111111
11111111
11111111
11111111
11111111
11111111
11111111
11111111
11111111
11111111
11111111
11111111
11111111
11111111
11111111
11111111
11111111
11111111
11111111
11111111
11111111
11111111
11111111
11111111
11111111
11111111
11111111
11111111
11111111
11111111
11111111
11111111
11111111
11111111
11111111
11111111
11111111
11111111
11111111
11111111
11111111
11111111
11111111
11111111
11111111
11111111
11111111
11111111
11111111
11111111
11111111
11111111
11111111
11111111
11111111
11111111
11111111
11111111
11111111
11111111
11111111
11111111
11111111
11111111
11111111
11111111
11111111
11111111
11111111
11111111
11111111
11111111
11111111
11111111
11111111
11111111
11111111
11111111
11111111
11111111
11111111
11111111
11111111
11111111
11111111
11111111
11111111
11111111
11111111
11111111
11111111
11111111
11111111
11111111
11111111
11111111
11111111
11111111
11111111
11111111
11111111
11111111
11111111
11111111
11111111
11111111
11111111
11111111
11111111
11111111
11111111
11111111
11111111
11111111
11111111
11111111
11111111
11111111
11111111
11111111
11111111
11111111
11111111
11111111
11111111
11111111
11111111
11111111
11111111
11111111
11111111
11111111
11111111
11111111
11111111
11111111
11111111
11111111
11111111
11111111
11111111
11111111
11111111
11111111
11111111
11111111
11111111
11111111
11111111
11111111
11111111
11111111
11111111
11111111
11111111
11111111
11111111
11111111
11111111
11111111
11111111
11111111
11111111
11111111
11111111
11111111
11111111
11111111
11111111
11111111
11111111
11111111
11111111
11111111
11111111
11111111
11111111
11111111
11111111
11111111
11111111
11111111
11111111
11111111
11111111
11111111
11111111
11111111
11111111
11111111
11111111
11111111
11111111
11111111
11111111
11111111
11111111
11111111
11111111
11111111
11111111
11111111
11111111
11111111
11111111
11111111
11111111
11111111
11111111
11111111
11111111
11111111
11111111
11111111
11111111
11111111
11111111
11111111
11111111
11111111
11111111
11111111
11111111
11111111
11111111
11111111
11111111
11111111
11111111
11111111
11111111
11111111
11111111
11111111
11111111
11111111
11111111
11111111
11111111
11111111
11111111
11111111
11111111
11111111
11111111
11111111
11111111
11111111
11111111
11111111
11111111
11111111
11111111
11111111
11111111
11111111
11111111
11111111
11111111
11111111
11111111
11111111
11111111
11111111
11111111
11111111
11111111
11111111
11111111
11111111
11111111
11111111
11111111
11111111
11111111
11111111
11111111
11111111
11111111
11111111
11111111
11111111
11111111
11111111
11111111
11111111
11111111
11111111
11111111
11111111
11111111
11111111
11111111
11111111
11111111
11111111
11111111
11111111
11111111
11111111
11111111
11111111
11111111
11111111
11111111
11111111
11111111
11111111
11111111
11111111
11111111
11111111
11111111
11111111
11111111
11111111
11111111
11111111
11111111
11111111
11111111
11111111
11111111
11111111
11111111
11111111
11111111
11111111
11111111
11111111
11111111
11111111
11111111
11111111
11111111
11111111
11111111
11111111
11111111
11111111
11111111
11111111
11111111
11111111
11111111
11111111
11111111
11111111
11111111
11111111
11111111
11111111
11111111
11111111
11111111
11111111
11111111
11111111
11111111
11111111
11111111
11111111
11111111
11111111
11111111
11111111
11111111
11111111
11111111
11111111
11111111
11111111
11111111
11111111
11111111
11111111
11111111
11111111
11111111
11111111
11111111
11111111
11111111
11111111
11111111
11111111
11111111
11111111
11111111
11111111
11111111
11111111
11111111
11111111
11111111
11111111
11111111
11111111
11111111
11111111
11111111
11111111
11111111
11111111
11111111
11111111
11111111
11111111
11111111
11111111
11111111
11111111
11111111
11111111
11111111
11111111
11111111
11111111
11111111
11111111
11111111
11111111
11111111
11111111
11111111
11111111
11111111
11111111
11111111
11111111
11111111
11111111
11111111
11111111
11111111
11111111
11111111
11111111
11111111
11111111
11111111
11111111
11111111
11111111
11111111
11111111
11111111
11111111
11111111
11111111
11111111
11111111
11111111
11111111
11111111
11111111
11111111
11111111
11111111
11111111
11111111
11111111
11111111
11111111
11111111
11111111
11111111
11111111
11111111
11111111
11111111
11111111
11111111
11111111
11111111
11111111
11111111
11111111
11111111
11111111
11111111
11111111
11111111
11111111
11111111
11111111
11111111
11111111
11111111
11111111
11111111
11111111
11111111
11111111
11111111
11111111
00000000
00000000
00000000
00000000
00000000
00000000
00000000
00000000
00000000
00010000
00010000
00010000
00010000
00000000
00010000
00000000
00000000
00100100
00100100
00000000
00000000
00000000
00000000
00000000
00000000
00100100
01111110
00100100
00100100
01111110
00100100
00000000
00000000
00001000
00111110
00101000
00111110
00001010
00111110
00001000
00000000
01100010
01100100
00001000
00010000
00100110
01000110
00000000
00000000
00010000
00101000
00010000
00101010
01000100
00111010
00000000
00000000
00001000
00010000
00000000
00000000
00000000
00000000
00000000
00000000
00000100
00001000
00001000
00001000
00001000
00000100
00000000
00000000
00100000
00010000
00010000
00010000
00010000
00100000
00000000
00000000
00000000
00010100
00001000
00111110
00001000
00010100
00000000
00000000
00000000
00001000
00001000
00111110
00001000
00001000
00000000
00000000
00000000
00000000
00000000
00000000
00001000
00001000
00010000
00000000
00000000
00000000
00000000
00111110
00000000
00000000
00000000
00000000
00000000
00000000
00000000
00000000
00011000
00011000
00000000
00000000
00000000
00000010
00000100
00001000
00010000
00100000
00000000
00000000
00111100
01000110
01001010
01010010
01100010
00111100
00000000
00000000
00011000
00101000
00001000
00001000
00001000
00111110
00000000
00000000
00111100
01000010
00000010
00111100
01000000
01111110
00000000
00000000
00111100
01000010
00001100
00000010
01000010
00111100
00000000
00000000
00001000
00011000
00101000
01001000
01111110
00001000
00000000
00000000
01111110
01000000
01111100
00000010
01000010
00111100
00000000
00000000
00111100
01000000
01111100
01000010
01000010
00111100
00000000
00000000
01111110
00000010
00000100
00001000
00010000
00010000
00000000
00000000
00111100
01000010
00111100
01000010
01000010
00111100
00000000
00000000
00111100
01000010
01000010
00111110
00000010
00111100
00000000
00000000
00000000
00000000
00010000
00000000
00000000
00010000
00000000
00000000
00000000
00010000
00000000
00000000
00010000
00010000
00100000
00000000
00000000
00000100
00001000
00010000
00001000
00000100
00000000
00000000
00000000
00000000
00111110
00000000
00111110
00000000
00000000
00000000
00000000
00010000
00001000
00000100
00001000
00010000
00000000
00000000
00111100
01000010
00000100
00001000
00000000
00001000
00000000
00000000
00111100
01001010
01010110
01011110
01000000
00111100
00000000
00000000
00111100
01000010
01000010
01111110
01000010
01000010
00000000
00000000
01111100
01000010
01111100
01000010
01000010
01111100
00000000
00000000
00111100
01000010
01000000
01000000
01000010
00111100
00000000
00000000
01111000
01000100
01000010
01000010
01000100
01111000
00000000
00000000
01111110
01000000
01111100
01000000
01000000
01111110
00000000
00000000
01111110
01000000
01111100
01000000
01000000
01000000
00000000
00000000
00111100
01000010
01000000
01001110
01000010
00111100
00000000
00000000
01000010
01000010
01111110
01000010
01000010
01000010
00000000
00000000
00111110
00001000
00001000
00001000
00001000
00111110
00000000
00000000
00000010
00000010
00000010
01000010
01000010
00111100
00000000
00000000
01000100
01001000
01110000
01001000
01000100
01000010
00000000
00000000
01000000
01000000
01000000
01000000
01000000
01111110
00000000
00000000
01000010
01100110
01011010
01000010
01000010
01000010
00000000
00000000
01000010
01100010
01010010
01001010
01000110
01000010
00000000
00000000
00111100
01000010
01000010
01000010
01000010
00111100
00000000
00000000
01111100
01000010
01000010
01111100
01000000
01000000
00000000
00000000
00111100
01000010
01000010
01010010
01001010
00111100
00000000
00000000
01111100
01000010
01000010
01111100
01000100
01000010
00000000
00000000
00111100
01000000
00111100
00000010
01000010
00111100
00000000
00000000
11111110
00010000
00010000
00010000
00010000
00010000
00000000
00000000
01000010
01000010
01000010
01000010
01000010
00111100
00000000
00000000
01000010
01000010
01000010
01000010
00100100
00011000
00000000
00000000
01000010
01000010
01000010
01000010
01011010
00100100
00000000
00000000
01000010
00100100
00011000
00011000
00100100
01000010
00000000
00000000
10000010
01000100
00101000
00010000
00010000
00010000
00000000
00000000
01111110
00000100
00001000
00010000
00100000
01111110
00000000
00000000
00001110
00001000
00001000
00001000
00001000
00001110
00000000
00000000
00000000
01000000
00100000
00010000
00001000
00000100
00000000
00000000
01110000
00010000
00010000
00010000
00010000
01110000
00000000
00000000
00010000
00111000
01010100
00010000
00010000
00010000
00000000
00000000
00000000
00000000
00000000
00000000
00000000
00000000
11111111
00000000
00011100
00100010
01111000
00100000
00100000
01111110
00000000
00000000
00000000
00111000
00000100
00111100
01000100
00111100
00000000
00000000
00100000
00100000
00111100
00100010
00100010
00111100
00000000
00000000
00000000
00011100
00100000
00100000
00100000
00011100
00000000
00000000
00000100
00000100
00111100
01000100
01000100
00111100
00000000
00000000
00000000
00111000
01000100
01111000
01000000
00111100
00000000
00000000
00001100
00010000
00011000
00010000
00010000
00010000
00000000
00000000
00000000
00111100
01000100
01000100
00111100
00000100
00111000
00000000
01000000
01000000
01111000
01000100
01000100
01000100
00000000
00000000
00010000
00000000
00110000
00010000
00010000
00111000
00000000
00000000
00000100
00000000
00000100
00000100
00000100
00100100
00011000
00000000
00100000
00101000
00110000
00110000
00101000
00100100
00000000
00000000
00010000
00010000
00010000
00010000
00010000
00001100
00000000
00000000
00000000
01101000
01010100
01010100
01010100
01010100
00000000
00000000
00000000
01111000
01000100
01000100
01000100
01000100
00000000
00000000
00000000
00111000
01000100
01000100
01000100
00111000
00000000
00000000
00000000
01111000
01000100
01000100
01111000
01000000
01000000
00000000
00000000
00111100
01000100
01000100
00111100
00000100
00000110
00000000
00000000
00011100
00100000
00100000
00100000
00100000
00000000
00000000
00000000
00111000
01000000
00111000
00000100
01111000
00000000
00000000
00010000
00111000
00010000
00010000
00010000
00001100
00000000
00000000
00000000
01000100
01000100
01000100
01000100
00111000
00000000
00000000
00000000
01000100
01000100
00101000
00101000
00010000
00000000
00000000
00000000
01000100
01010100
01010100
01010100
00101000
00000000
00000000
00000000
01000100
00101000
00010000
00101000
01000100
00000000
00000000
00000000
01000100
01000100
01000100
00111100
00000100
00111000
00000000
00000000
01111100
00001000
00010000
00100000
01111100
00000000
00000000
00001110
00001000
00110000
00001000
00001000
00001110
00000000
00000000
00001000
00001000
00001000
00001000
00001000
00001000
00000000
00000000
01110000
00010000
00001100
00010000
00010000
01110000
00000000
00000000
00010100
00101000
00000000
00000000
00000000
00000000
00000000
00111100
01000010
10011001
10100001
10100001
10011001
01000010
00111100
/zx_ula/branches/xilinx/spectrum_48k_for_digilent_spartan3_starter_kit_with_ps2_keyboard/display.v
0,0 → 1,78
`timescale 1ns / 1ps
//////////////////////////////////////////////////////////////////////////////////
// Company: Dept. Architecture and Computing Technology. University of Seville
// Engineer: Miguel Angel Rodriguez Jodar. rodriguj@atc.us.es
//
// Create Date: 19:13:39 20-May-2011
// Design Name: 7-segment display for Spartan 3 Starter Board
// Module Name: 7-segment display for Spartan 3 Starter Board
// Project Name:
// Target Devices:
// Tool versions:
// Description:
//
// Dependencies:
//
// Revision:
// Revision 1.00 - File Created
// Additional Comments: GPL License policies apply to the contents of this file.
//
//////////////////////////////////////////////////////////////////////////////////
module display(
input clk, // some megahertzs are enough
input load, // positive-edge load signal
input [15:0] valor, // 16-bit (4 hex digit) value to show
output [3:0] an, // 4 anodes (4 displays)
output [6:0] seg // 7 cathodes per display
);
 
reg [3:0] ranodo = 4'b1110;
assign an = ranodo;
reg [6:0] rseg = 7'b0000000;
assign seg = rseg;
reg [3:0] rvalor[0:3];
reg [1:0] digito = 2'b00;
 
reg [15:0] contador = 16'h0000;
wire clkdisplay = contador[15];
always @(posedge clk)
contador <= contador + 1;
 
always @(posedge load)
begin
rvalor[0] <= valor[3:0];
rvalor[1] <= valor[7:4];
rvalor[2] <= valor[11:8];
rvalor[3] <= valor[15:12];
end
always @(posedge clkdisplay)
begin
digito = digito + 1;
ranodo = {ranodo[2:0],ranodo[3]};
rseg = ~hex2seg(rvalor[digito]);
end
 
function [6:0] hex2seg (input [3:0] v);
case (v)
0: hex2seg = 7'b1101111;
1: hex2seg = 7'b0100100;
2: hex2seg = 7'b1110011;
3: hex2seg = 7'b1110110;
4: hex2seg = 7'b0111100;
5: hex2seg = 7'b1011110;
6: hex2seg = 7'b1011111;
7: hex2seg = 7'b1101100;
8: hex2seg = 7'b1111111;
9: hex2seg = 7'b1111110;
10: hex2seg = 7'b1111101;
11: hex2seg = 7'b0011111;
12: hex2seg = 7'b1001011;
13: hex2seg = 7'b0110111;
14: hex2seg = 7'b1011011;
15: hex2seg = 7'b1011001;
endcase
endfunction
 
endmodule
/zx_ula/branches/xilinx/spectrum_48k_for_digilent_spartan3_starter_kit_with_ps2_keyboard/master_clock.v
0,0 → 1,75
////////////////////////////////////////////////////////////////////////////////
// Copyright (c) 1995-2010 Xilinx, Inc. All rights reserved.
////////////////////////////////////////////////////////////////////////////////
// ____ ____
// / /\/ /
// /___/ \ / Vendor: Xilinx
// \ \ \/ Version : 12.4
// \ \ Application : xaw2verilog
// / / Filename : master_clock.v
// /___/ /\ Timestamp : 04/21/2012 19:26:35
// \ \ / \
// \___\/\___\
//
//Command: xaw2verilog -st C:\\proyectos_xilinx\ulaplus\ipcore_dir\.\master_clock.xaw C:\\proyectos_xilinx\ulaplus\ipcore_dir\.\master_clock
//Design Name: master_clock
//Device: xc3s1000-ft256-4
//
// Module master_clock
// Generated by Xilinx Architecture Wizard
// Written for synthesis tool: XST
// Period Jitter (unit interval) for block DCM_INST = 0.05 UI
// Period Jitter (Peak-to-Peak) for block DCM_INST = 1.92 ns
`timescale 1ns / 1ps
 
module master_clock(CLKIN_IN,
CLKFX_OUT,
CLKIN_IBUFG_OUT,
CLK0_OUT);
 
input CLKIN_IN;
output CLKFX_OUT;
output CLKIN_IBUFG_OUT;
output CLK0_OUT;
wire CLKFB_IN;
wire CLKFX_BUF;
wire CLKIN_IBUFG;
wire CLK0_BUF;
wire GND_BIT;
assign GND_BIT = 0;
assign CLKIN_IBUFG_OUT = CLKIN_IBUFG;
assign CLK0_OUT = CLKFB_IN;
BUFG CLKFX_BUFG_INST (.I(CLKFX_BUF),
.O(CLKFX_OUT));
IBUFG CLKIN_IBUFG_INST (.I(CLKIN_IN),
.O(CLKIN_IBUFG));
BUFG CLK0_BUFG_INST (.I(CLK0_BUF),
.O(CLKFB_IN));
DCM #( .CLK_FEEDBACK("1X"), .CLKDV_DIVIDE(2.0), .CLKFX_DIVIDE(25),
.CLKFX_MULTIPLY(14), .CLKIN_DIVIDE_BY_2("FALSE"),
.CLKIN_PERIOD(20.000), .CLKOUT_PHASE_SHIFT("NONE"),
.DESKEW_ADJUST("SYSTEM_SYNCHRONOUS"), .DFS_FREQUENCY_MODE("LOW"),
.DLL_FREQUENCY_MODE("LOW"), .DUTY_CYCLE_CORRECTION("TRUE"),
.FACTORY_JF(16'h8080), .PHASE_SHIFT(0), .STARTUP_WAIT("FALSE") )
DCM_INST (.CLKFB(CLKFB_IN),
.CLKIN(CLKIN_IBUFG),
.DSSEN(GND_BIT),
.PSCLK(GND_BIT),
.PSEN(GND_BIT),
.PSINCDEC(GND_BIT),
.RST(GND_BIT),
.CLKDV(),
.CLKFX(CLKFX_BUF),
.CLKFX180(),
.CLK0(CLK0_BUF),
.CLK2X(),
.CLK2X180(),
.CLK90(),
.CLK180(),
.CLK270(),
.LOCKED(),
.PSDONE(),
.STATUS());
endmodule
/zx_ula/branches/xilinx/spectrum_48k_for_digilent_spartan3_starter_kit_with_ps2_keyboard/ps2controller.v
0,0 → 1,365
//-------------------------------------------------------------------------------------
//
// Author: John Clayton
// Date : April 30, 2001
// Update: 4/30/01 copied this file from lcd_2.v (pared down).
// Update: 5/24/01 changed the first module from "ps2_keyboard_receiver"
// to "ps2_keyboard_interface"
// Update: 5/29/01 Added input synchronizing flip-flops. Changed state
// encoding (m1) for good operation after part config.
// Update: 5/31/01 Added low drive strength and slow transitions to ps2_clk
// and ps2_data in the constraints file. Added the signal
// "tx_shifting_done" as distinguished from "rx_shifting_done."
// Debugged the transmitter portion in the lab.
// Update: 6/01/01 Added horizontal tab to the ascii output.
// Update: 6/01/01 Added parameter TRAP_SHIFT_KEYS.
// Update: 6/05/01 Debugged the "debounce" timer functionality.
// Used 60usec timer as a "watchdog" timeout during
// receive from the keyboard. This means that a keyboard
// can now be "hot plugged" into the interface, without
// messing up the bit_count, since the bit_count is reset
// to zero during periods of inactivity anyway. This was
// difficult to debug. I ended up using the logic analyzer,
// and had to scratch my head quite a bit.
// Update: 6/06/01 Removed extra comments before the input synchronizing
// flip-flops. Used the correct parameter to size the
// 5usec_timer_count. Changed the name of this file from
// ps2.v to ps2_keyboard.v
// Update: 6/06/01 Removed "&& q[7:0]" in output_strobe logic. Removed extra
// commented out "else" condition in the shift register and
// bit counter.
// Update: 6/07/01 Changed default values for 60usec timer parameters so that
// they correspond to 60usec for a 49.152MHz clock.
//
//
//
//
//
// Description
//-------------------------------------------------------------------------------------
// This is a state-machine driven serial-to-parallel and parallel-to-serial
// interface to the ps2 style keyboard interface. The details of the operation
// of the keyboard interface were obtained from the following website:
//
// http://www.beyondlogic.org/keyboard/keybrd.htm
//
// Some aspects of the keyboard interface are not implemented (e.g, parity
// checking for the receive side, and recognition of the various commands
// which the keyboard sends out, such as "power on selt test passed," "Error"
// and "Resend.") However, if the user wishes to recognize these reply
// messages, the scan code output can always be used to extend functionality
// as desired.
//
// Note that the "Extended" (0xE0) and "Released" (0xF0) codes are recognized.
// The rx interface provides separate indicator flags for these two conditions
// with every valid character scan code which it provides. The shift keys are
// also trapped by the interface, in order to provide correct uppercase ASCII
// characters at the ascii output, although the scan codes for the shift keys
// are still provided at the scan code output. So, the left/right ALT keys
// can be differentiated by the presence of the rx_entended signal, while the
// left/right shift keys are differentiable by the different scan codes
// received.
//
// The interface to the ps2 keyboard uses ps2_clk clock rates of
// 30-40 kHz, dependent upon the keyboard itself. The rate at which the state
// machine runs should be at least twice the rate of the ps2_clk, so that the
// states can accurately follow the clock signal itself. Four times
// oversampling is better. Say 200kHz at least. The upper limit for clocking
// the state machine will undoubtedly be determined by delays in the logic
// which decodes the scan codes into ASCII equivalents. The maximum speed
// will be most likely many megahertz, depending upon target technology.
// In order to run the state machine extremely fast, synchronizing flip-flops
// have been added to the ps2_clk and ps2_data inputs of the state machine.
// This avoids poor performance related to slow transitions of the inputs.
//
// Because this is a bi-directional interface, while reading from the keyboard
// the ps2_clk and ps2_data lines are used as inputs. While writing to the
// keyboard, however (which may be done at any time. If writing interrupts a
// read from the keyboard, the keyboard will buffer up its data, and send
// it later) both the ps2_clk and ps2_data lines are occasionally pulled low,
// and pullup resistors are used to bring the lines high again, by setting
// the drivers to high impedance state.
//
// The tx interface, for writing to the keyboard, does not provide any special
// pre-processing. It simply transmits the 8-bit command value to the
// keyboard.
//
// Pullups MUST BE USED on the ps2_clk and ps2_data lines for this design,
// whether they be internal to an FPGA I/O pad, or externally placed.
// If internal pullups are used, they may be fairly weak, causing bounces
// due to crosstalk, etc. There is a "debounce timer" implemented in order
// to eliminate erroneous state transitions which would occur based on bounce.
//
// Parameters are provided in order to configure and appropriately size the
// counter of a 60 microsecond timer used in the transmitter, depending on
// the clock frequency used. The 60 microsecond period is guaranteed to be
// more than one period of the ps2_clk_s signal.
//
// Also, a smaller 5 microsecond timer has been included for "debounce".
// This is used because, with internal pullups on the ps2_clk and ps2_data
// lines, there is some bouncing around which occurs
//
// A parameter TRAP_SHIFT_KEYS allows the user to eliminate shift keypresses
// from producing scan codes (along with their "undefined" ASCII equivalents)
// at the output of the interface. If TRAP_SHIFT_KEYS is non-zero, the shift
// key status will only be reported by rx_shift_key_on. No ascii or scan
// codes will be reported for the shift keys. This is useful for those who
// wish to use the ASCII data stream, and who don't want to have to "filter
// out" the shift key codes.
//
//-------------------------------------------------------------------------------------
`resetall
`timescale 1ns/100ps
 
`define TOTAL_BITS 11 //total data bits of the data package
`define EXTEND_CODE 8'hE0 //extend code
`define RELEASE_CODE 8'hF0 //release code
 
module ps2_keyboard(
clk,
reset,
ps2_clk,
ps2_data,
interrupt,
rx_scan_code
);
 
// Parameters
 
// The timer value can be up to (2^bits) inclusive.
parameter TIMER_60USEC_VALUE_PP = 840; // Number of sys_clks for 60usec. (for a 14Mhz clock)
parameter TIMER_60USEC_BITS_PP = 10; // Number of bits needed for timer
 
// State encodings, provided as parameters
// for flexibility to the one instantiating the module.
// In general, the default values need not be changed.
 
// State "m1_rx_clk_l" has been chosen on purpose. Since the input
// synchronizing flip-flops initially contain zero, it takes one clk
// for them to update to reflect the actual (idle = high) status of
// the I/O lines from the keyboard. Therefore, choosing 0 for m1_rx_clk_l
// allows the state machine to transition to m1_rx_clk_h when the true
// values of the input signals become present at the outputs of the
// synchronizing flip-flops. This initial transition is harmless, and it
// eliminates the need for a "reset" pulse before the interface can operate.
 
parameter m1_rx_clk_h = 1;
parameter m1_rx_clk_l = 0;
parameter m1_rx_falling_edge_marker = 3;
parameter m1_rx_rising_edge_marker = 4;
 
// I/O declarations
input clk;
input reset;
input ps2_clk;
input ps2_data;
output interrupt;
output [7:0] rx_scan_code;
//output [7:0] rx_ascii;
 
reg rx_extended;
reg rx_released;
reg [7:0] rx_scan_code;
reg interrupt;
 
 
 
// Internal signal declarations
wire timer_60usec_done;
wire extended;
wire released;
// NOTE: These two signals used to be one. They
// were split into two signals because of
// shift key trapping. With shift key
// trapping, no event is generated externally,
// but the "hold" data must still be cleared
// anyway regardless, in preparation for the
// next scan codes.
wire rx_output_strobe; // Used to produce the actual output.
wire rx_shifting_done;
 
reg [`TOTAL_BITS-1:0] q;
reg [3:0] m1_state;
reg [3:0] m1_next_state;
reg [3:0] bit_count;
 
reg enable_timer_60usec;
reg [TIMER_60USEC_BITS_PP-1:0] timer_60usec_count;
 
 
reg ps2_clk_s; // Synchronous version of this input
reg ps2_data_s; // Synchronous version of this input
 
 
//--------------------------------------------------------------------------
// Module code
 
// Input "synchronizing" logic -- synchronizes the inputs to the state
// machine clock, thus avoiding errors related to
// spurious state machine transitions.
always @(posedge clk)
begin
ps2_clk_s <= ps2_clk;
ps2_data_s <= ps2_data;
end
 
// State register
always @(posedge clk)
begin : m1_state_register
if (reset) m1_state <= m1_rx_clk_h;
else m1_state <= m1_next_state;
end
 
// State transition logic
always @(m1_state
or q
or ps2_clk_s
or ps2_data_s
or timer_60usec_done
)
begin : m1_state_logic
 
// Output signals default to this value, unless changed in a state condition.
 
enable_timer_60usec <= 0;
 
case (m1_state)
 
m1_rx_clk_h :
begin
enable_timer_60usec <= 1;
if (~ps2_clk_s) m1_next_state <= m1_rx_falling_edge_marker;
else m1_next_state <= m1_rx_clk_h;
end
m1_rx_falling_edge_marker :
begin
enable_timer_60usec <= 0;
m1_next_state <= m1_rx_clk_l;
end
 
m1_rx_rising_edge_marker :
begin
enable_timer_60usec <= 0;
m1_next_state <= m1_rx_clk_h;
end
 
m1_rx_clk_l :
begin
enable_timer_60usec <= 1;
if (ps2_clk_s) m1_next_state <= m1_rx_rising_edge_marker;
else m1_next_state <= m1_rx_clk_l;
end
default : m1_next_state <= m1_rx_clk_h;
endcase
end
 
 
// This is the bit counter
 
always @(posedge clk)
begin
if ( reset
|| rx_shifting_done
)
bit_count <= 0; // normal reset
else if (timer_60usec_done
&& (m1_state == m1_rx_clk_h)
&& (ps2_clk_s)
)
bit_count <= 0; // rx watchdog timer reset
else if ( (m1_state == m1_rx_falling_edge_marker) // increment for rx
)
bit_count <= bit_count + 1;
end
// This signal is high for one clock at the end of the timer count.
 
assign rx_shifting_done = (bit_count == `TOTAL_BITS);
 
 
 
// This is the signal which enables loading of the shift register.
// It also indicates "ack" to the device writing to the transmitter.
 
 
// This is the ODD parity bit for the transmitted word.
 
 
// This is the shift register
always @(posedge clk)
begin
if (reset) q <= 0;
else if ( (m1_state == m1_rx_falling_edge_marker) )
q <= {ps2_data_s,q[`TOTAL_BITS-1:1]};
end
 
// This is the 60usec timer counter
 
always @(posedge clk)
begin
if (~enable_timer_60usec) timer_60usec_count <= 0;
else if (~timer_60usec_done) timer_60usec_count <= timer_60usec_count + 1;
end
 
assign timer_60usec_done = (timer_60usec_count == (TIMER_60USEC_VALUE_PP - 1));
 
 
 
// Create the signals which indicate special scan codes received.
// These are the "unlatched versions."
 
assign extended = (q[8:1] == `EXTEND_CODE) && rx_shifting_done;
assign released = (q[8:1] == `RELEASE_CODE) && rx_shifting_done;
 
 
// Store the special scan code status bits
// Not the final output, but an intermediate storage place,
// until the entire set of output data can be assembled.
 
// Output the special scan code flags, the scan code and the ascii
always @(posedge clk)
begin
if (reset)
begin
rx_scan_code <= 0;
interrupt<=0;
end
else if (rx_output_strobe) //if not extended, not relaeased,get the scan_code
begin
rx_scan_code <= q[8:1];
interrupt<=1;
end
else
begin
//rx_scan_code<=rx_scan_code;
interrupt<=0;
end
end
 
// Store the final rx output data only when all extend and release codes
// are received and the next (actual key) scan code is also ready.
// (the presence of rx_extended or rx_released refers to the
// the current latest scan code received, not the previously latched flags.)
 
 
assign rx_output_strobe = rx_shifting_done;
// && ~extended
// && ~released
// );
 
// This part translates the scan code into an ASCII value...
// Only the ASCII codes which I considered important have been included.
// if you want more, just add the appropriate case statement lines...
// (You will need to know the keyboard scan codes you wish to assign.)
// The entries are listed in ascending order of ASCII value.
 
endmodule
 
//`undefine TOTAL_BITS
//`undefine EXTEND_CODE
//`undefine RELEASE_CODE
//`undefine LEFT_SHIFT
//`undefine RIGHT_SHIFT
 
/zx_ula/branches/xilinx/spectrum_48k_for_digilent_spartan3_starter_kit_with_ps2_keyboard/tv80_mcode.v
0,0 → 1,2650
//
// TV80 8-Bit Microprocessor Core
// Based on the VHDL T80 core by Daniel Wallner (jesus@opencores.org)
//
// Copyright (c) 2004,2007 Guy Hutchison (ghutchis@opencores.org)
//
// Permission is hereby granted, free of charge, to any person obtaining a
// copy of this software and associated documentation files (the "Software"),
// to deal in the Software without restriction, including without limitation
// the rights to use, copy, modify, merge, publish, distribute, sublicense,
// and/or sell copies of the Software, and to permit persons to whom the
// Software is furnished to do so, subject to the following conditions:
//
// The above copyright notice and this permission notice shall be included
// in all copies or substantial portions of the Software.
//
// THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND,
// EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF
// MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT.
// IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY
// CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT,
// TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE
// SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
 
module tv80_mcode
(/*AUTOARG*/
// Outputs
MCycles, TStates, Prefix, Inc_PC, Inc_WZ, IncDec_16, Read_To_Reg,
Read_To_Acc, Set_BusA_To, Set_BusB_To, ALU_Op, Save_ALU, PreserveC,
Arith16, Set_Addr_To, IORQ, Jump, JumpE, JumpXY, Call, RstP, LDZ,
LDW, LDSPHL, Special_LD, ExchangeDH, ExchangeRp, ExchangeAF,
ExchangeRS, I_DJNZ, I_CPL, I_CCF, I_SCF, I_RETN, I_BT, I_BC, I_BTR,
I_RLD, I_RRD, I_INRC, SetDI, SetEI, IMode, Halt, NoRead, Write,
// Inputs
IR, ISet, MCycle, F, NMICycle, IntCycle
);
parameter Mode = 0;
parameter Flag_C = 0;
parameter Flag_N = 1;
parameter Flag_P = 2;
parameter Flag_X = 3;
parameter Flag_H = 4;
parameter Flag_Y = 5;
parameter Flag_Z = 6;
parameter Flag_S = 7;
 
input [7:0] IR;
input [1:0] ISet ;
input [6:0] MCycle ;
input [7:0] F ;
input NMICycle ;
input IntCycle ;
output [2:0] MCycles ;
output [2:0] TStates ;
output [1:0] Prefix ; // None,BC,ED,DD/FD
output Inc_PC ;
output Inc_WZ ;
output [3:0] IncDec_16 ; // BC,DE,HL,SP 0 is inc
output Read_To_Reg ;
output Read_To_Acc ;
output [3:0] Set_BusA_To ; // B,C,D,E,H,L,DI/DB,A,SP(L),SP(M),0,F
output [3:0] Set_BusB_To ; // B,C,D,E,H,L,DI,A,SP(L),SP(M),1,F,PC(L),PC(M),0
output [3:0] ALU_Op ;
output Save_ALU ;
output PreserveC ;
output Arith16 ;
output [2:0] Set_Addr_To ; // aNone,aXY,aIOA,aSP,aBC,aDE,aZI
output IORQ ;
output Jump ;
output JumpE ;
output JumpXY ;
output Call ;
output RstP ;
output LDZ ;
output LDW ;
output LDSPHL ;
output [2:0] Special_LD ; // A,I;A,R;I,A;R,A;None
output ExchangeDH ;
output ExchangeRp ;
output ExchangeAF ;
output ExchangeRS ;
output I_DJNZ ;
output I_CPL ;
output I_CCF ;
output I_SCF ;
output I_RETN ;
output I_BT ;
output I_BC ;
output I_BTR ;
output I_RLD ;
output I_RRD ;
output I_INRC ;
output SetDI ;
output SetEI ;
output [1:0] IMode ;
output Halt ;
output NoRead ;
output Write ;
 
// regs
reg [2:0] MCycles ;
reg [2:0] TStates ;
reg [1:0] Prefix ; // None,BC,ED,DD/FD
reg Inc_PC ;
reg Inc_WZ ;
reg [3:0] IncDec_16 ; // BC,DE,HL,SP 0 is inc
reg Read_To_Reg ;
reg Read_To_Acc ;
reg [3:0] Set_BusA_To ; // B,C,D,E,H,L,DI/DB,A,SP(L),SP(M),0,F
reg [3:0] Set_BusB_To ; // B,C,D,E,H,L,DI,A,SP(L),SP(M),1,F,PC(L),PC(M),0
reg [3:0] ALU_Op ;
reg Save_ALU ;
reg PreserveC ;
reg Arith16 ;
reg [2:0] Set_Addr_To ; // aNone,aXY,aIOA,aSP,aBC,aDE,aZI
reg IORQ ;
reg Jump ;
reg JumpE ;
reg JumpXY ;
reg Call ;
reg RstP ;
reg LDZ ;
reg LDW ;
reg LDSPHL ;
reg [2:0] Special_LD ; // A,I;A,R;I,A;R,A;None
reg ExchangeDH ;
reg ExchangeRp ;
reg ExchangeAF ;
reg ExchangeRS ;
reg I_DJNZ ;
reg I_CPL ;
reg I_CCF ;
reg I_SCF ;
reg I_RETN ;
reg I_BT ;
reg I_BC ;
reg I_BTR ;
reg I_RLD ;
reg I_RRD ;
reg I_INRC ;
reg SetDI ;
reg SetEI ;
reg [1:0] IMode ;
reg Halt ;
reg NoRead ;
reg Write ;
 
parameter aNone = 3'b111;
parameter aBC = 3'b000;
parameter aDE = 3'b001;
parameter aXY = 3'b010;
parameter aIOA = 3'b100;
parameter aSP = 3'b101;
parameter aZI = 3'b110;
// constant aNone : std_logic_vector[2:0] = 3'b000;
// constant aXY : std_logic_vector[2:0] = 3'b001;
// constant aIOA : std_logic_vector[2:0] = 3'b010;
// constant aSP : std_logic_vector[2:0] = 3'b011;
// constant aBC : std_logic_vector[2:0] = 3'b100;
// constant aDE : std_logic_vector[2:0] = 3'b101;
// constant aZI : std_logic_vector[2:0] = 3'b110;
 
function is_cc_true;
input [7:0] FF;
input [2:0] cc;
begin
if (Mode == 3 )
begin
case (cc)
3'b000 : is_cc_true = FF[7] == 1'b0; // NZ
3'b001 : is_cc_true = FF[7] == 1'b1; // Z
3'b010 : is_cc_true = FF[4] == 1'b0; // NC
3'b011 : is_cc_true = FF[4] == 1'b1; // C
3'b100 : is_cc_true = 0;
3'b101 : is_cc_true = 0;
3'b110 : is_cc_true = 0;
3'b111 : is_cc_true = 0;
endcase
end
else
begin
case (cc)
3'b000 : is_cc_true = FF[6] == 1'b0; // NZ
3'b001 : is_cc_true = FF[6] == 1'b1; // Z
3'b010 : is_cc_true = FF[0] == 1'b0; // NC
3'b011 : is_cc_true = FF[0] == 1'b1; // C
3'b100 : is_cc_true = FF[2] == 1'b0; // PO
3'b101 : is_cc_true = FF[2] == 1'b1; // PE
3'b110 : is_cc_true = FF[7] == 1'b0; // P
3'b111 : is_cc_true = FF[7] == 1'b1; // M
endcase
end
end
endfunction // is_cc_true
 
reg [2:0] DDD;
reg [2:0] SSS;
reg [1:0] DPAIR;
always @ (/*AUTOSENSE*/F or IR or ISet or IntCycle or MCycle
or NMICycle)
begin
DDD = IR[5:3];
SSS = IR[2:0];
DPAIR = IR[5:4];
 
MCycles = 3'b001;
if (MCycle[0] )
begin
TStates = 3'b100;
end
else
begin
TStates = 3'b011;
end
Prefix = 2'b00;
Inc_PC = 1'b0;
Inc_WZ = 1'b0;
IncDec_16 = 4'b0000;
Read_To_Acc = 1'b0;
Read_To_Reg = 1'b0;
Set_BusB_To = 4'b0000;
Set_BusA_To = 4'b0000;
ALU_Op = { 1'b0, IR[5:3] };
Save_ALU = 1'b0;
PreserveC = 1'b0;
Arith16 = 1'b0;
IORQ = 1'b0;
Set_Addr_To = aNone;
Jump = 1'b0;
JumpE = 1'b0;
JumpXY = 1'b0;
Call = 1'b0;
RstP = 1'b0;
LDZ = 1'b0;
LDW = 1'b0;
LDSPHL = 1'b0;
Special_LD = 3'b000;
ExchangeDH = 1'b0;
ExchangeRp = 1'b0;
ExchangeAF = 1'b0;
ExchangeRS = 1'b0;
I_DJNZ = 1'b0;
I_CPL = 1'b0;
I_CCF = 1'b0;
I_SCF = 1'b0;
I_RETN = 1'b0;
I_BT = 1'b0;
I_BC = 1'b0;
I_BTR = 1'b0;
I_RLD = 1'b0;
I_RRD = 1'b0;
I_INRC = 1'b0;
SetDI = 1'b0;
SetEI = 1'b0;
IMode = 2'b11;
Halt = 1'b0;
NoRead = 1'b0;
Write = 1'b0;
case (ISet)
2'b00 :
begin
 
//----------------------------------------------------------------------------
//
// Unprefixed instructions
//
//----------------------------------------------------------------------------
 
casez (IR)
// 8 BIT LOAD GROUP
8'b01zzzzzz :
begin
if (IR[5:0] == 6'b110110)
Halt = 1'b1;
else if (IR[2:0] == 3'b110)
begin
// LD r,(HL)
MCycles = 3'b010;
if (MCycle[0])
Set_Addr_To = aXY;
if (MCycle[1])
begin
Set_BusA_To[2:0] = DDD;
Read_To_Reg = 1'b1;
end
end // if (IR[2:0] == 3'b110)
else if (IR[5:3] == 3'b110)
begin
// LD (HL),r
MCycles = 3'b010;
if (MCycle[0])
begin
Set_Addr_To = aXY;
Set_BusB_To[2:0] = SSS;
Set_BusB_To[3] = 1'b0;
end
if (MCycle[1])
Write = 1'b1;
end // if (IR[5:3] == 3'b110)
else
begin
Set_BusB_To[2:0] = SSS;
ExchangeRp = 1'b1;
Set_BusA_To[2:0] = DDD;
Read_To_Reg = 1'b1;
end // else: !if(IR[5:3] == 3'b110)
end // case: 8'b01zzzzzz
 
8'b00zzz110 :
begin
if (IR[5:3] == 3'b110)
begin
// LD (HL),n
MCycles = 3'b011;
if (MCycle[1])
begin
Inc_PC = 1'b1;
Set_Addr_To = aXY;
Set_BusB_To[2:0] = SSS;
Set_BusB_To[3] = 1'b0;
end
if (MCycle[2])
Write = 1'b1;
end // if (IR[5:3] == 3'b110)
else
begin
// LD r,n
MCycles = 3'b010;
if (MCycle[1])
begin
Inc_PC = 1'b1;
Set_BusA_To[2:0] = DDD;
Read_To_Reg = 1'b1;
end
end
end
8'b00001010 :
begin
// LD A,(BC)
MCycles = 3'b010;
if (MCycle[0])
Set_Addr_To = aBC;
if (MCycle[1])
Read_To_Acc = 1'b1;
end // case: 8'b00001010
8'b00011010 :
begin
// LD A,(DE)
MCycles = 3'b010;
if (MCycle[0])
Set_Addr_To = aDE;
if (MCycle[1])
Read_To_Acc = 1'b1;
end // case: 8'b00011010
8'b00111010 :
begin
if (Mode == 3 )
begin
// LDD A,(HL)
MCycles = 3'b010;
if (MCycle[0])
Set_Addr_To = aXY;
if (MCycle[1])
begin
Read_To_Acc = 1'b1;
IncDec_16 = 4'b1110;
end
end
else
begin
// LD A,(nn)
MCycles = 3'b100;
if (MCycle[1])
begin
Inc_PC = 1'b1;
LDZ = 1'b1;
end
if (MCycle[2])
begin
Set_Addr_To = aZI;
Inc_PC = 1'b1;
end
if (MCycle[3])
begin
Read_To_Acc = 1'b1;
end
end // else: !if(Mode == 3 )
end // case: 8'b00111010
8'b00000010 :
begin
// LD (BC),A
MCycles = 3'b010;
if (MCycle[0])
begin
Set_Addr_To = aBC;
Set_BusB_To = 4'b0111;
end
if (MCycle[1])
begin
Write = 1'b1;
end
end // case: 8'b00000010
8'b00010010 :
begin
// LD (DE),A
MCycles = 3'b010;
case (1'b1) // MCycle
MCycle[0] :
begin
Set_Addr_To = aDE;
Set_BusB_To = 4'b0111;
end
MCycle[1] :
Write = 1'b1;
default :;
endcase // case(MCycle)
end // case: 8'b00010010
8'b00110010 :
begin
if (Mode == 3 )
begin
// LDD (HL),A
MCycles = 3'b010;
case (1'b1) // MCycle
MCycle[0] :
begin
Set_Addr_To = aXY;
Set_BusB_To = 4'b0111;
end
MCycle[1] :
begin
Write = 1'b1;
IncDec_16 = 4'b1110;
end
default :;
endcase // case(MCycle)
end
else
begin
// LD (nn),A
MCycles = 3'b100;
case (1'b1) // MCycle
MCycle[1] :
begin
Inc_PC = 1'b1;
LDZ = 1'b1;
end
MCycle[2] :
begin
Set_Addr_To = aZI;
Inc_PC = 1'b1;
Set_BusB_To = 4'b0111;
end
MCycle[3] :
begin
Write = 1'b1;
end
default :;
endcase
end // else: !if(Mode == 3 )
end // case: 8'b00110010
 
// 16 BIT LOAD GROUP
8'b00000001,8'b00010001,8'b00100001,8'b00110001 :
begin
// LD dd,nn
MCycles = 3'b011;
case (1'b1) // MCycle
MCycle[1] :
begin
Inc_PC = 1'b1;
Read_To_Reg = 1'b1;
if (DPAIR == 2'b11 )
begin
Set_BusA_To[3:0] = 4'b1000;
end
else
begin
Set_BusA_To[2:1] = DPAIR;
Set_BusA_To[0] = 1'b1;
end
end // case: 2
MCycle[2] :
begin
Inc_PC = 1'b1;
Read_To_Reg = 1'b1;
if (DPAIR == 2'b11 )
begin
Set_BusA_To[3:0] = 4'b1001;
end
else
begin
Set_BusA_To[2:1] = DPAIR;
Set_BusA_To[0] = 1'b0;
end
end // case: 3
default :;
endcase // case(MCycle)
end // case: 8'b00000001,8'b00010001,8'b00100001,8'b00110001
8'b00101010 :
begin
if (Mode == 3 )
begin
// LDI A,(HL)
MCycles = 3'b010;
case (1'b1) // MCycle
MCycle[0] :
Set_Addr_To = aXY;
MCycle[1] :
begin
Read_To_Acc = 1'b1;
IncDec_16 = 4'b0110;
end
default :;
endcase
end
else
begin
// LD HL,(nn)
MCycles = 3'b101;
case (1'b1) // MCycle
MCycle[1] :
begin
Inc_PC = 1'b1;
LDZ = 1'b1;
end
MCycle[2] :
begin
Set_Addr_To = aZI;
Inc_PC = 1'b1;
LDW = 1'b1;
end
MCycle[3] :
begin
Set_BusA_To[2:0] = 3'b101; // L
Read_To_Reg = 1'b1;
Inc_WZ = 1'b1;
Set_Addr_To = aZI;
end
MCycle[4] :
begin
Set_BusA_To[2:0] = 3'b100; // H
Read_To_Reg = 1'b1;
end
default :;
endcase
end // else: !if(Mode == 3 )
end // case: 8'b00101010
8'b00100010 :
begin
if (Mode == 3 )
begin
// LDI (HL),A
MCycles = 3'b010;
case (1'b1) // MCycle
MCycle[0] :
begin
Set_Addr_To = aXY;
Set_BusB_To = 4'b0111;
end
MCycle[1] :
begin
Write = 1'b1;
IncDec_16 = 4'b0110;
end
default :;
endcase
end
else
begin
// LD (nn),HL
MCycles = 3'b101;
case (1'b1) // MCycle
MCycle[1] :
begin
Inc_PC = 1'b1;
LDZ = 1'b1;
end
MCycle[2] :
begin
Set_Addr_To = aZI;
Inc_PC = 1'b1;
LDW = 1'b1;
Set_BusB_To = 4'b0101; // L
end
MCycle[3] :
begin
Inc_WZ = 1'b1;
Set_Addr_To = aZI;
Write = 1'b1;
Set_BusB_To = 4'b0100; // H
end
MCycle[4] :
Write = 1'b1;
default :;
endcase
end // else: !if(Mode == 3 )
end // case: 8'b00100010
8'b11111001 :
begin
// LD SP,HL
TStates = 3'b110;
LDSPHL = 1'b1;
end
8'b11zz0101 :
begin
// PUSH qq
MCycles = 3'b011;
case (1'b1) // MCycle
MCycle[0] :
begin
TStates = 3'b101;
IncDec_16 = 4'b1111;
Set_Addr_To = aSP;
if (DPAIR == 2'b11 )
begin
Set_BusB_To = 4'b0111;
end
else
begin
Set_BusB_To[2:1] = DPAIR;
Set_BusB_To[0] = 1'b0;
Set_BusB_To[3] = 1'b0;
end
end // case: 1
MCycle[1] :
begin
IncDec_16 = 4'b1111;
Set_Addr_To = aSP;
if (DPAIR == 2'b11 )
begin
Set_BusB_To = 4'b1011;
end
else
begin
Set_BusB_To[2:1] = DPAIR;
Set_BusB_To[0] = 1'b1;
Set_BusB_To[3] = 1'b0;
end
Write = 1'b1;
end // case: 2
MCycle[2] :
Write = 1'b1;
default :;
endcase // case(MCycle)
end // case: 8'b11000101,8'b11010101,8'b11100101,8'b11110101
8'b11zz0001 :
begin
// POP qq
MCycles = 3'b011;
case (1'b1) // MCycle
MCycle[0] :
Set_Addr_To = aSP;
MCycle[1] :
begin
IncDec_16 = 4'b0111;
Set_Addr_To = aSP;
Read_To_Reg = 1'b1;
if (DPAIR == 2'b11 )
begin
Set_BusA_To[3:0] = 4'b1011;
end
else
begin
Set_BusA_To[2:1] = DPAIR;
Set_BusA_To[0] = 1'b1;
end
end // case: 2
MCycle[2] :
begin
IncDec_16 = 4'b0111;
Read_To_Reg = 1'b1;
if (DPAIR == 2'b11 )
begin
Set_BusA_To[3:0] = 4'b0111;
end
else
begin
Set_BusA_To[2:1] = DPAIR;
Set_BusA_To[0] = 1'b0;
end
end // case: 3
default :;
endcase // case(MCycle)
end // case: 8'b11000001,8'b11010001,8'b11100001,8'b11110001
 
// EXCHANGE, BLOCK TRANSFER AND SEARCH GROUP
8'b11101011 :
begin
if (Mode != 3 )
begin
// EX DE,HL
ExchangeDH = 1'b1;
end
end
8'b00001000 :
begin
if (Mode == 3 )
begin
// LD (nn),SP
MCycles = 3'b101;
case (1'b1) // MCycle
MCycle[1] :
begin
Inc_PC = 1'b1;
LDZ = 1'b1;
end
MCycle[2] :
begin
Set_Addr_To = aZI;
Inc_PC = 1'b1;
LDW = 1'b1;
Set_BusB_To = 4'b1000;
end
MCycle[3] :
begin
Inc_WZ = 1'b1;
Set_Addr_To = aZI;
Write = 1'b1;
Set_BusB_To = 4'b1001;
end
MCycle[4] :
Write = 1'b1;
default :;
endcase
end
else if (Mode < 2 )
begin
// EX AF,AF'
ExchangeAF = 1'b1;
end
end // case: 8'b00001000
8'b11011001 :
begin
if (Mode == 3 )
begin
// RETI
MCycles = 3'b011;
case (1'b1) // MCycle
MCycle[0] :
Set_Addr_To = aSP;
MCycle[1] :
begin
IncDec_16 = 4'b0111;
Set_Addr_To = aSP;
LDZ = 1'b1;
end
MCycle[2] :
begin
Jump = 1'b1;
IncDec_16 = 4'b0111;
I_RETN = 1'b1;
SetEI = 1'b1;
end
default :;
endcase
end
else if (Mode < 2 )
begin
// EXX
ExchangeRS = 1'b1;
end
end // case: 8'b11011001
8'b11100011 :
begin
if (Mode != 3 )
begin
// EX (SP),HL
MCycles = 3'b101;
case (1'b1) // MCycle
MCycle[0] :
Set_Addr_To = aSP;
MCycle[1] :
begin
Read_To_Reg = 1'b1;
Set_BusA_To = 4'b0101;
Set_BusB_To = 4'b0101;
Set_Addr_To = aSP;
end
MCycle[2] :
begin
IncDec_16 = 4'b0111;
Set_Addr_To = aSP;
TStates = 3'b100;
Write = 1'b1;
end
MCycle[3] :
begin
Read_To_Reg = 1'b1;
Set_BusA_To = 4'b0100;
Set_BusB_To = 4'b0100;
Set_Addr_To = aSP;
end
MCycle[4] :
begin
IncDec_16 = 4'b1111;
TStates = 3'b101;
Write = 1'b1;
end
default :;
endcase
end // if (Mode != 3 )
end // case: 8'b11100011
 
// 8 BIT ARITHMETIC AND LOGICAL GROUP
8'b10zzzzzz :
begin
if (IR[2:0] == 3'b110)
begin
// ADD A,(HL)
// ADC A,(HL)
// SUB A,(HL)
// SBC A,(HL)
// AND A,(HL)
// OR A,(HL)
// XOR A,(HL)
// CP A,(HL)
MCycles = 3'b010;
case (1'b1) // MCycle
MCycle[0] :
Set_Addr_To = aXY;
MCycle[1] :
begin
Read_To_Reg = 1'b1;
Save_ALU = 1'b1;
Set_BusB_To[2:0] = SSS;
Set_BusA_To[2:0] = 3'b111;
end
default :;
endcase // case(MCycle)
end // if (IR[2:0] == 3'b110)
else
begin
// ADD A,r
// ADC A,r
// SUB A,r
// SBC A,r
// AND A,r
// OR A,r
// XOR A,r
// CP A,r
Set_BusB_To[2:0] = SSS;
Set_BusA_To[2:0] = 3'b111;
Read_To_Reg = 1'b1;
Save_ALU = 1'b1;
end // else: !if(IR[2:0] == 3'b110)
end // case: 8'b10000000,8'b10000001,8'b10000010,8'b10000011,8'b10000100,8'b10000101,8'b10000111,...
8'b11zzz110 :
begin
// ADD A,n
// ADC A,n
// SUB A,n
// SBC A,n
// AND A,n
// OR A,n
// XOR A,n
// CP A,n
MCycles = 3'b010;
if (MCycle[1] )
begin
Inc_PC = 1'b1;
Read_To_Reg = 1'b1;
Save_ALU = 1'b1;
Set_BusB_To[2:0] = SSS;
Set_BusA_To[2:0] = 3'b111;
end
end
8'b00zzz100 :
begin
if (IR[5:3] == 3'b110)
begin
// INC (HL)
MCycles = 3'b011;
case (1'b1) // MCycle
MCycle[0] :
Set_Addr_To = aXY;
MCycle[1] :
begin
TStates = 3'b100;
Set_Addr_To = aXY;
Read_To_Reg = 1'b1;
Save_ALU = 1'b1;
PreserveC = 1'b1;
ALU_Op = 4'b0000;
Set_BusB_To = 4'b1010;
Set_BusA_To[2:0] = DDD;
end // case: 2
MCycle[2] :
Write = 1'b1;
default :;
endcase // case(MCycle)
end // case: 8'b00110100
else
begin
// INC r
Set_BusB_To = 4'b1010;
Set_BusA_To[2:0] = DDD;
Read_To_Reg = 1'b1;
Save_ALU = 1'b1;
PreserveC = 1'b1;
ALU_Op = 4'b0000;
end
end
8'b00zzz101 :
begin
if (IR[5:3] == 3'b110)
begin
// DEC (HL)
MCycles = 3'b011;
case (1'b1) // MCycle
MCycle[0] :
Set_Addr_To = aXY;
MCycle[1] :
begin
TStates = 3'b100;
Set_Addr_To = aXY;
ALU_Op = 4'b0010;
Read_To_Reg = 1'b1;
Save_ALU = 1'b1;
PreserveC = 1'b1;
Set_BusB_To = 4'b1010;
Set_BusA_To[2:0] = DDD;
end // case: 2
MCycle[2] :
Write = 1'b1;
default :;
endcase // case(MCycle)
end
else
begin
// DEC r
Set_BusB_To = 4'b1010;
Set_BusA_To[2:0] = DDD;
Read_To_Reg = 1'b1;
Save_ALU = 1'b1;
PreserveC = 1'b1;
ALU_Op = 4'b0010;
end
end
// GENERAL PURPOSE ARITHMETIC AND CPU CONTROL GROUPS
8'b00100111 :
begin
// DAA
Set_BusA_To[2:0] = 3'b111;
Read_To_Reg = 1'b1;
ALU_Op = 4'b1100;
Save_ALU = 1'b1;
end
8'b00101111 :
// CPL
I_CPL = 1'b1;
8'b00111111 :
// CCF
I_CCF = 1'b1;
8'b00110111 :
// SCF
I_SCF = 1'b1;
8'b00000000 :
begin
if (NMICycle == 1'b1 )
begin
// NMI
MCycles = 3'b011;
case (1'b1) // MCycle
MCycle[0] :
begin
TStates = 3'b101;
IncDec_16 = 4'b1111;
Set_Addr_To = aSP;
Set_BusB_To = 4'b1101;
end
MCycle[1] :
begin
TStates = 3'b100;
Write = 1'b1;
IncDec_16 = 4'b1111;
Set_Addr_To = aSP;
Set_BusB_To = 4'b1100;
end
MCycle[2] :
begin
TStates = 3'b100;
Write = 1'b1;
end
default :;
endcase // case(MCycle)
end
else if (IntCycle == 1'b1 )
begin
// INT (IM 2)
MCycles = 3'b101;
case (1'b1) // MCycle
MCycle[0] :
begin
LDZ = 1'b1;
TStates = 3'b101;
IncDec_16 = 4'b1111;
Set_Addr_To = aSP;
Set_BusB_To = 4'b1101;
end
MCycle[1] :
begin
TStates = 3'b100;
Write = 1'b1;
IncDec_16 = 4'b1111;
Set_Addr_To = aSP;
Set_BusB_To = 4'b1100;
end
MCycle[2] :
begin
TStates = 3'b100;
Write = 1'b1;
end
MCycle[3] :
begin
Inc_PC = 1'b1;
LDZ = 1'b1;
end
MCycle[4] :
Jump = 1'b1;
default :;
endcase
end
end // case: 8'b00000000
8'b11110011 :
// DI
SetDI = 1'b1;
8'b11111011 :
// EI
SetEI = 1'b1;
 
// 16 BIT ARITHMETIC GROUP
8'b00zz1001 :
begin
// ADD HL,ss
MCycles = 3'b011;
case (1'b1) // MCycle
MCycle[1] :
begin
NoRead = 1'b1;
ALU_Op = 4'b0000;
Read_To_Reg = 1'b1;
Save_ALU = 1'b1;
Set_BusA_To[2:0] = 3'b101;
case (IR[5:4])
0,1,2 :
begin
Set_BusB_To[2:1] = IR[5:4];
Set_BusB_To[0] = 1'b1;
end
default :
Set_BusB_To = 4'b1000;
endcase // case(IR[5:4])
TStates = 3'b100;
Arith16 = 1'b1;
end // case: 2
MCycle[2] :
begin
NoRead = 1'b1;
Read_To_Reg = 1'b1;
Save_ALU = 1'b1;
ALU_Op = 4'b0001;
Set_BusA_To[2:0] = 3'b100;
case (IR[5:4])
0,1,2 :
Set_BusB_To[2:1] = IR[5:4];
default :
Set_BusB_To = 4'b1001;
endcase
Arith16 = 1'b1;
end // case: 3
default :;
endcase // case(MCycle)
end // case: 8'b00001001,8'b00011001,8'b00101001,8'b00111001
8'b00zz0011 :
begin
// INC ss
TStates = 3'b110;
IncDec_16[3:2] = 2'b01;
IncDec_16[1:0] = DPAIR;
end
8'b00zz1011 :
begin
// DEC ss
TStates = 3'b110;
IncDec_16[3:2] = 2'b11;
IncDec_16[1:0] = DPAIR;
end
 
// ROTATE AND SHIFT GROUP
8'b00000111,
// RLCA
8'b00010111,
// RLA
8'b00001111,
// RRCA
8'b00011111 :
// RRA
begin
Set_BusA_To[2:0] = 3'b111;
ALU_Op = 4'b1000;
Read_To_Reg = 1'b1;
Save_ALU = 1'b1;
end // case: 8'b00000111,...
 
// JUMP GROUP
8'b11000011 :
begin
// JP nn
MCycles = 3'b011;
if (MCycle[1])
begin
Inc_PC = 1'b1;
LDZ = 1'b1;
end
if (MCycle[2])
begin
Inc_PC = 1'b1;
Jump = 1'b1;
end
end // case: 8'b11000011
8'b11zzz010 :
begin
if (IR[5] == 1'b1 && Mode == 3 )
begin
case (IR[4:3])
2'b00 :
begin
// LD ($FF00+C),A
MCycles = 3'b010;
case (1'b1) // MCycle
MCycle[0] :
begin
Set_Addr_To = aBC;
Set_BusB_To = 4'b0111;
end
MCycle[1] :
begin
Write = 1'b1;
IORQ = 1'b1;
end
default :;
endcase // case(MCycle)
end // case: 2'b00
2'b01 :
begin
// LD (nn),A
MCycles = 3'b100;
case (1'b1) // MCycle
MCycle[1] :
begin
Inc_PC = 1'b1;
LDZ = 1'b1;
end
MCycle[2] :
begin
Set_Addr_To = aZI;
Inc_PC = 1'b1;
Set_BusB_To = 4'b0111;
end
MCycle[3] :
Write = 1'b1;
default :;
endcase // case(MCycle)
end // case: default :...
2'b10 :
begin
// LD A,($FF00+C)
MCycles = 3'b010;
case (1'b1) // MCycle
MCycle[0] :
Set_Addr_To = aBC;
MCycle[1] :
begin
Read_To_Acc = 1'b1;
IORQ = 1'b1;
end
default :;
endcase // case(MCycle)
end // case: 2'b10
2'b11 :
begin
// LD A,(nn)
MCycles = 3'b100;
case (1'b1) // MCycle
MCycle[1] :
begin
Inc_PC = 1'b1;
LDZ = 1'b1;
end
MCycle[2] :
begin
Set_Addr_To = aZI;
Inc_PC = 1'b1;
end
MCycle[3] :
Read_To_Acc = 1'b1;
default :;
endcase // case(MCycle)
end
endcase
end
else
begin
// JP cc,nn
MCycles = 3'b011;
case (1'b1) // MCycle
MCycle[1] :
begin
Inc_PC = 1'b1;
LDZ = 1'b1;
end
MCycle[2] :
begin
Inc_PC = 1'b1;
if (is_cc_true(F, IR[5:3]) )
begin
Jump = 1'b1;
end
end
default :;
endcase
end // else: !if(DPAIR == 2'b11 )
end // case: 8'b11000010,8'b11001010,8'b11010010,8'b11011010,8'b11100010,8'b11101010,8'b11110010,8'b11111010
8'b00011000 :
begin
if (Mode != 2 )
begin
// JR e
MCycles = 3'b011;
case (1'b1) // MCycle
MCycle[1] :
Inc_PC = 1'b1;
MCycle[2] :
begin
NoRead = 1'b1;
JumpE = 1'b1;
TStates = 3'b101;
end
default :;
endcase
end // if (Mode != 2 )
end // case: 8'b00011000
 
// Conditional relative jumps (JR [C/NC/Z/NZ], e)
8'b001zz000 :
begin
if (Mode != 2 )
begin
MCycles = 3'd3;
case (1'b1) // MCycle
MCycle[1] :
begin
Inc_PC = 1'b1;
 
case (IR[4:3])
0 : MCycles = (F[Flag_Z]) ? 3'd2 : 3'd3;
1 : MCycles = (!F[Flag_Z]) ? 3'd2 : 3'd3;
2 : MCycles = (F[Flag_C]) ? 3'd2 : 3'd3;
3 : MCycles = (!F[Flag_C]) ? 3'd2 : 3'd3;
endcase
end
MCycle[2] :
begin
NoRead = 1'b1;
JumpE = 1'b1;
TStates = 3'd5;
end
default :;
endcase
end // if (Mode != 2 )
end // case: 8'b00111000
8'b11101001 :
// JP (HL)
JumpXY = 1'b1;
8'b00010000 :
begin
if (Mode == 3 )
begin
I_DJNZ = 1'b1;
end
else if (Mode < 2 )
begin
// DJNZ,e
MCycles = 3'b011;
case (1'b1) // MCycle
MCycle[0] :
begin
TStates = 3'b101;
I_DJNZ = 1'b1;
Set_BusB_To = 4'b1010;
Set_BusA_To[2:0] = 3'b000;
Read_To_Reg = 1'b1;
Save_ALU = 1'b1;
ALU_Op = 4'b0010;
end
MCycle[1] :
begin
I_DJNZ = 1'b1;
Inc_PC = 1'b1;
end
MCycle[2] :
begin
NoRead = 1'b1;
JumpE = 1'b1;
TStates = 3'b101;
end
default :;
endcase
end // if (Mode < 2 )
end // case: 8'b00010000
 
// CALL AND RETURN GROUP
8'b11001101 :
begin
// CALL nn
MCycles = 3'b101;
case (1'b1) // MCycle
MCycle[1] :
begin
Inc_PC = 1'b1;
LDZ = 1'b1;
end
MCycle[2] :
begin
IncDec_16 = 4'b1111;
Inc_PC = 1'b1;
TStates = 3'b100;
Set_Addr_To = aSP;
LDW = 1'b1;
Set_BusB_To = 4'b1101;
end
MCycle[3] :
begin
Write = 1'b1;
IncDec_16 = 4'b1111;
Set_Addr_To = aSP;
Set_BusB_To = 4'b1100;
end
MCycle[4] :
begin
Write = 1'b1;
Call = 1'b1;
end
default :;
endcase // case(MCycle)
end // case: 8'b11001101
8'b11zzz100 :
begin
if (IR[5] == 1'b0 || Mode != 3 )
begin
// CALL cc,nn
MCycles = 3'b101;
case (1'b1) // MCycle
MCycle[1] :
begin
Inc_PC = 1'b1;
LDZ = 1'b1;
end
MCycle[2] :
begin
Inc_PC = 1'b1;
LDW = 1'b1;
if (is_cc_true(F, IR[5:3]) )
begin
IncDec_16 = 4'b1111;
Set_Addr_To = aSP;
TStates = 3'b100;
Set_BusB_To = 4'b1101;
end
else
begin
MCycles = 3'b011;
end // else: !if(is_cc_true(F, IR[5:3]) )
end // case: 3
MCycle[3] :
begin
Write = 1'b1;
IncDec_16 = 4'b1111;
Set_Addr_To = aSP;
Set_BusB_To = 4'b1100;
end
MCycle[4] :
begin
Write = 1'b1;
Call = 1'b1;
end
default :;
endcase
end // if (IR[5] == 1'b0 || Mode != 3 )
end // case: 8'b11000100,8'b11001100,8'b11010100,8'b11011100,8'b11100100,8'b11101100,8'b11110100,8'b11111100
8'b11001001 :
begin
// RET
MCycles = 3'b011;
case (1'b1) // MCycle
MCycle[0] :
begin
TStates = 3'b101;
Set_Addr_To = aSP;
end
MCycle[1] :
begin
IncDec_16 = 4'b0111;
Set_Addr_To = aSP;
LDZ = 1'b1;
end
MCycle[2] :
begin
Jump = 1'b1;
IncDec_16 = 4'b0111;
end
default :;
endcase // case(MCycle)
end // case: 8'b11001001
8'b11000000,8'b11001000,8'b11010000,8'b11011000,8'b11100000,8'b11101000,8'b11110000,8'b11111000 :
begin
if (IR[5] == 1'b1 && Mode == 3 )
begin
case (IR[4:3])
2'b00 :
begin
// LD ($FF00+nn),A
MCycles = 3'b011;
case (1'b1) // MCycle
MCycle[1] :
begin
Inc_PC = 1'b1;
Set_Addr_To = aIOA;
Set_BusB_To = 4'b0111;
end
MCycle[2] :
Write = 1'b1;
default :;
endcase // case(MCycle)
end // case: 2'b00
2'b01 :
begin
// ADD SP,n
MCycles = 3'b011;
case (1'b1) // MCycle
MCycle[1] :
begin
ALU_Op = 4'b0000;
Inc_PC = 1'b1;
Read_To_Reg = 1'b1;
Save_ALU = 1'b1;
Set_BusA_To = 4'b1000;
Set_BusB_To = 4'b0110;
end
MCycle[2] :
begin
NoRead = 1'b1;
Read_To_Reg = 1'b1;
Save_ALU = 1'b1;
ALU_Op = 4'b0001;
Set_BusA_To = 4'b1001;
Set_BusB_To = 4'b1110; // Incorrect unsigned !!!!!!!!!!!!!!!!!!!!!
end
default :;
endcase // case(MCycle)
end // case: 2'b01
2'b10 :
begin
// LD A,($FF00+nn)
MCycles = 3'b011;
case (1'b1) // MCycle
MCycle[1] :
begin
Inc_PC = 1'b1;
Set_Addr_To = aIOA;
end
MCycle[2] :
Read_To_Acc = 1'b1;
default :;
endcase // case(MCycle)
end // case: 2'b10
2'b11 :
begin
// LD HL,SP+n -- Not correct !!!!!!!!!!!!!!!!!!!
MCycles = 3'b101;
case (1'b1) // MCycle
MCycle[1] :
begin
Inc_PC = 1'b1;
LDZ = 1'b1;
end
MCycle[2] :
begin
Set_Addr_To = aZI;
Inc_PC = 1'b1;
LDW = 1'b1;
end
MCycle[3] :
begin
Set_BusA_To[2:0] = 3'b101; // L
Read_To_Reg = 1'b1;
Inc_WZ = 1'b1;
Set_Addr_To = aZI;
end
MCycle[4] :
begin
Set_BusA_To[2:0] = 3'b100; // H
Read_To_Reg = 1'b1;
end
default :;
endcase // case(MCycle)
end // case: 2'b11
endcase // case(IR[4:3])
end
else
begin
// RET cc
MCycles = 3'b011;
case (1'b1) // MCycle
MCycle[0] :
begin
if (is_cc_true(F, IR[5:3]) )
begin
Set_Addr_To = aSP;
end
else
begin
MCycles = 3'b001;
end
TStates = 3'b101;
end // case: 1
MCycle[1] :
begin
IncDec_16 = 4'b0111;
Set_Addr_To = aSP;
LDZ = 1'b1;
end
MCycle[2] :
begin
Jump = 1'b1;
IncDec_16 = 4'b0111;
end
default :;
endcase
end // else: !if(IR[5] == 1'b1 && Mode == 3 )
end // case: 8'b11000000,8'b11001000,8'b11010000,8'b11011000,8'b11100000,8'b11101000,8'b11110000,8'b11111000
8'b11000111,8'b11001111,8'b11010111,8'b11011111,8'b11100111,8'b11101111,8'b11110111,8'b11111111 :
begin
// RST p
MCycles = 3'b011;
case (1'b1) // MCycle
MCycle[0] :
begin
TStates = 3'b101;
IncDec_16 = 4'b1111;
Set_Addr_To = aSP;
Set_BusB_To = 4'b1101;
end
MCycle[1] :
begin
Write = 1'b1;
IncDec_16 = 4'b1111;
Set_Addr_To = aSP;
Set_BusB_To = 4'b1100;
end
MCycle[2] :
begin
Write = 1'b1;
RstP = 1'b1;
end
default :;
endcase // case(MCycle)
end // case: 8'b11000111,8'b11001111,8'b11010111,8'b11011111,8'b11100111,8'b11101111,8'b11110111,8'b11111111
// INPUT AND OUTPUT GROUP
8'b11011011 :
begin
if (Mode != 3 )
begin
// IN A,(n)
MCycles = 3'b011;
case (1'b1) // MCycle
MCycle[1] :
begin
Inc_PC = 1'b1;
Set_Addr_To = aIOA;
end
MCycle[2] :
begin
Read_To_Acc = 1'b1;
IORQ = 1'b1;
end
default :;
endcase
end // if (Mode != 3 )
end // case: 8'b11011011
8'b11010011 :
begin
if (Mode != 3 )
begin
// OUT (n),A
MCycles = 3'b011;
case (1'b1) // MCycle
MCycle[1] :
begin
Inc_PC = 1'b1;
Set_Addr_To = aIOA;
Set_BusB_To = 4'b0111;
end
MCycle[2] :
begin
Write = 1'b1;
IORQ = 1'b1;
end
default :;
endcase
end // if (Mode != 3 )
end // case: 8'b11010011
 
//----------------------------------------------------------------------------
//----------------------------------------------------------------------------
// MULTIBYTE INSTRUCTIONS
//----------------------------------------------------------------------------
//----------------------------------------------------------------------------
 
8'b11001011 :
begin
if (Mode != 2 )
begin
Prefix = 2'b01;
end
end
 
8'b11101101 :
begin
if (Mode < 2 )
begin
Prefix = 2'b10;
end
end
 
8'b11011101,8'b11111101 :
begin
if (Mode < 2 )
begin
Prefix = 2'b11;
end
end
endcase // case(IR)
end // case: 2'b00
 
2'b01 :
begin
 
//----------------------------------------------------------------------------
//
// CB prefixed instructions
//
//----------------------------------------------------------------------------
Set_BusA_To[2:0] = IR[2:0];
Set_BusB_To[2:0] = IR[2:0];
casez (IR)
8'b00000000,8'b00000001,8'b00000010,8'b00000011,8'b00000100,8'b00000101,8'b00000111,
8'b00010000,8'b00010001,8'b00010010,8'b00010011,8'b00010100,8'b00010101,8'b00010111,
8'b00001000,8'b00001001,8'b00001010,8'b00001011,8'b00001100,8'b00001101,8'b00001111,
8'b00011000,8'b00011001,8'b00011010,8'b00011011,8'b00011100,8'b00011101,8'b00011111,
8'b00100000,8'b00100001,8'b00100010,8'b00100011,8'b00100100,8'b00100101,8'b00100111,
8'b00101000,8'b00101001,8'b00101010,8'b00101011,8'b00101100,8'b00101101,8'b00101111,
8'b00110000,8'b00110001,8'b00110010,8'b00110011,8'b00110100,8'b00110101,8'b00110111,
8'b00111000,8'b00111001,8'b00111010,8'b00111011,8'b00111100,8'b00111101,8'b00111111 :
begin
// RLC r
// RL r
// RRC r
// RR r
// SLA r
// SRA r
// SRL r
// SLL r (Undocumented) / SWAP r
if (MCycle[0] ) begin
ALU_Op = 4'b1000;
Read_To_Reg = 1'b1;
Save_ALU = 1'b1;
end
end // case: 8'b00000000,8'b00000001,8'b00000010,8'b00000011,8'b00000100,8'b00000101,8'b00000111,...
8'b00zzz110 :
begin
// RLC (HL)
// RL (HL)
// RRC (HL)
// RR (HL)
// SRA (HL)
// SRL (HL)
// SLA (HL)
// SLL (HL) (Undocumented) / SWAP (HL)
MCycles = 3'b011;
case (1'b1) // MCycle
MCycle[0], MCycle[6] :
Set_Addr_To = aXY;
MCycle[1] :
begin
ALU_Op = 4'b1000;
Read_To_Reg = 1'b1;
Save_ALU = 1'b1;
Set_Addr_To = aXY;
TStates = 3'b100;
end
MCycle[2] :
Write = 1'b1;
default :;
endcase // case(MCycle)
end // case: 8'b00000110,8'b00010110,8'b00001110,8'b00011110,8'b00101110,8'b00111110,8'b00100110,8'b00110110
8'b01000000,8'b01000001,8'b01000010,8'b01000011,8'b01000100,8'b01000101,8'b01000111,
8'b01001000,8'b01001001,8'b01001010,8'b01001011,8'b01001100,8'b01001101,8'b01001111,
8'b01010000,8'b01010001,8'b01010010,8'b01010011,8'b01010100,8'b01010101,8'b01010111,
8'b01011000,8'b01011001,8'b01011010,8'b01011011,8'b01011100,8'b01011101,8'b01011111,
8'b01100000,8'b01100001,8'b01100010,8'b01100011,8'b01100100,8'b01100101,8'b01100111,
8'b01101000,8'b01101001,8'b01101010,8'b01101011,8'b01101100,8'b01101101,8'b01101111,
8'b01110000,8'b01110001,8'b01110010,8'b01110011,8'b01110100,8'b01110101,8'b01110111,
8'b01111000,8'b01111001,8'b01111010,8'b01111011,8'b01111100,8'b01111101,8'b01111111 :
begin
// BIT b,r
if (MCycle[0] )
begin
Set_BusB_To[2:0] = IR[2:0];
ALU_Op = 4'b1001;
end
end // case: 8'b01000000,8'b01000001,8'b01000010,8'b01000011,8'b01000100,8'b01000101,8'b01000111,...
8'b01000110,8'b01001110,8'b01010110,8'b01011110,8'b01100110,8'b01101110,8'b01110110,8'b01111110 :
begin
// BIT b,(HL)
MCycles = 3'b010;
case (1'b1) // MCycle
MCycle[0], MCycle[6] :
Set_Addr_To = aXY;
MCycle[1] :
begin
ALU_Op = 4'b1001;
TStates = 3'b100;
end
default :;
endcase // case(MCycle)
end // case: 8'b01000110,8'b01001110,8'b01010110,8'b01011110,8'b01100110,8'b01101110,8'b01110110,8'b01111110
8'b11000000,8'b11000001,8'b11000010,8'b11000011,8'b11000100,8'b11000101,8'b11000111,
8'b11001000,8'b11001001,8'b11001010,8'b11001011,8'b11001100,8'b11001101,8'b11001111,
8'b11010000,8'b11010001,8'b11010010,8'b11010011,8'b11010100,8'b11010101,8'b11010111,
8'b11011000,8'b11011001,8'b11011010,8'b11011011,8'b11011100,8'b11011101,8'b11011111,
8'b11100000,8'b11100001,8'b11100010,8'b11100011,8'b11100100,8'b11100101,8'b11100111,
8'b11101000,8'b11101001,8'b11101010,8'b11101011,8'b11101100,8'b11101101,8'b11101111,
8'b11110000,8'b11110001,8'b11110010,8'b11110011,8'b11110100,8'b11110101,8'b11110111,
8'b11111000,8'b11111001,8'b11111010,8'b11111011,8'b11111100,8'b11111101,8'b11111111 :
begin
// SET b,r
if (MCycle[0] )
begin
ALU_Op = 4'b1010;
Read_To_Reg = 1'b1;
Save_ALU = 1'b1;
end
end // case: 8'b11000000,8'b11000001,8'b11000010,8'b11000011,8'b11000100,8'b11000101,8'b11000111,...
8'b11000110,8'b11001110,8'b11010110,8'b11011110,8'b11100110,8'b11101110,8'b11110110,8'b11111110 :
begin
// SET b,(HL)
MCycles = 3'b011;
case (1'b1) // MCycle
MCycle[0], MCycle[6] :
Set_Addr_To = aXY;
MCycle[1] :
begin
ALU_Op = 4'b1010;
Read_To_Reg = 1'b1;
Save_ALU = 1'b1;
Set_Addr_To = aXY;
TStates = 3'b100;
end
MCycle[2] :
Write = 1'b1;
default :;
endcase // case(MCycle)
end // case: 8'b11000110,8'b11001110,8'b11010110,8'b11011110,8'b11100110,8'b11101110,8'b11110110,8'b11111110
8'b10000000,8'b10000001,8'b10000010,8'b10000011,8'b10000100,8'b10000101,8'b10000111,
8'b10001000,8'b10001001,8'b10001010,8'b10001011,8'b10001100,8'b10001101,8'b10001111,
8'b10010000,8'b10010001,8'b10010010,8'b10010011,8'b10010100,8'b10010101,8'b10010111,
8'b10011000,8'b10011001,8'b10011010,8'b10011011,8'b10011100,8'b10011101,8'b10011111,
8'b10100000,8'b10100001,8'b10100010,8'b10100011,8'b10100100,8'b10100101,8'b10100111,
8'b10101000,8'b10101001,8'b10101010,8'b10101011,8'b10101100,8'b10101101,8'b10101111,
8'b10110000,8'b10110001,8'b10110010,8'b10110011,8'b10110100,8'b10110101,8'b10110111,
8'b10111000,8'b10111001,8'b10111010,8'b10111011,8'b10111100,8'b10111101,8'b10111111 :
begin
// RES b,r
if (MCycle[0] )
begin
ALU_Op = 4'b1011;
Read_To_Reg = 1'b1;
Save_ALU = 1'b1;
end
end // case: 8'b10000000,8'b10000001,8'b10000010,8'b10000011,8'b10000100,8'b10000101,8'b10000111,...
8'b10000110,8'b10001110,8'b10010110,8'b10011110,8'b10100110,8'b10101110,8'b10110110,8'b10111110 :
begin
// RES b,(HL)
MCycles = 3'b011;
case (1'b1) // MCycle
MCycle[0], MCycle[6] :
Set_Addr_To = aXY;
MCycle[1] :
begin
ALU_Op = 4'b1011;
Read_To_Reg = 1'b1;
Save_ALU = 1'b1;
Set_Addr_To = aXY;
TStates = 3'b100;
end
MCycle[2] :
Write = 1'b1;
default :;
endcase // case(MCycle)
end // case: 8'b10000110,8'b10001110,8'b10010110,8'b10011110,8'b10100110,8'b10101110,8'b10110110,8'b10111110
endcase // case(IR)
end // case: 2'b01
default :
begin : default_ed_block
//----------------------------------------------------------------------------
//
// ED prefixed instructions
//
//----------------------------------------------------------------------------
 
casez (IR)
/*
* Undocumented NOP instructions commented out to reduce size of mcode
*
8'b00000000,8'b00000001,8'b00000010,8'b00000011,8'b00000100,8'b00000101,8'b00000110,8'b00000111
,8'b00001000,8'b00001001,8'b00001010,8'b00001011,8'b00001100,8'b00001101,8'b00001110,8'b00001111
,8'b00010000,8'b00010001,8'b00010010,8'b00010011,8'b00010100,8'b00010101,8'b00010110,8'b00010111
,8'b00011000,8'b00011001,8'b00011010,8'b00011011,8'b00011100,8'b00011101,8'b00011110,8'b00011111
,8'b00100000,8'b00100001,8'b00100010,8'b00100011,8'b00100100,8'b00100101,8'b00100110,8'b00100111
,8'b00101000,8'b00101001,8'b00101010,8'b00101011,8'b00101100,8'b00101101,8'b00101110,8'b00101111
,8'b00110000,8'b00110001,8'b00110010,8'b00110011,8'b00110100,8'b00110101,8'b00110110,8'b00110111
,8'b00111000,8'b00111001,8'b00111010,8'b00111011,8'b00111100,8'b00111101,8'b00111110,8'b00111111
 
,8'b10000000,8'b10000001,8'b10000010,8'b10000011,8'b10000100,8'b10000101,8'b10000110,8'b10000111
,8'b10001000,8'b10001001,8'b10001010,8'b10001011,8'b10001100,8'b10001101,8'b10001110,8'b10001111
,8'b10010000,8'b10010001,8'b10010010,8'b10010011,8'b10010100,8'b10010101,8'b10010110,8'b10010111
,8'b10011000,8'b10011001,8'b10011010,8'b10011011,8'b10011100,8'b10011101,8'b10011110,8'b10011111
, 8'b10100100,8'b10100101,8'b10100110,8'b10100111
, 8'b10101100,8'b10101101,8'b10101110,8'b10101111
, 8'b10110100,8'b10110101,8'b10110110,8'b10110111
, 8'b10111100,8'b10111101,8'b10111110,8'b10111111
,8'b11000000,8'b11000001,8'b11000010,8'b11000011,8'b11000100,8'b11000101,8'b11000110,8'b11000111
,8'b11001000,8'b11001001,8'b11001010,8'b11001011,8'b11001100,8'b11001101,8'b11001110,8'b11001111
,8'b11010000,8'b11010001,8'b11010010,8'b11010011,8'b11010100,8'b11010101,8'b11010110,8'b11010111
,8'b11011000,8'b11011001,8'b11011010,8'b11011011,8'b11011100,8'b11011101,8'b11011110,8'b11011111
,8'b11100000,8'b11100001,8'b11100010,8'b11100011,8'b11100100,8'b11100101,8'b11100110,8'b11100111
,8'b11101000,8'b11101001,8'b11101010,8'b11101011,8'b11101100,8'b11101101,8'b11101110,8'b11101111
,8'b11110000,8'b11110001,8'b11110010,8'b11110011,8'b11110100,8'b11110101,8'b11110110,8'b11110111
,8'b11111000,8'b11111001,8'b11111010,8'b11111011,8'b11111100,8'b11111101,8'b11111110,8'b11111111 :
; // NOP, undocumented
8'b01111110,8'b01111111 :
// NOP, undocumented
;
*/
// 8 BIT LOAD GROUP
8'b01010111 :
begin
// LD A,I
Special_LD = 3'b100;
TStates = 3'b101;
end
8'b01011111 :
begin
// LD A,R
Special_LD = 3'b101;
TStates = 3'b101;
end
8'b01000111 :
begin
// LD I,A
Special_LD = 3'b110;
TStates = 3'b101;
end
8'b01001111 :
begin
// LD R,A
Special_LD = 3'b111;
TStates = 3'b101;
end
// 16 BIT LOAD GROUP
8'b01001011,8'b01011011,8'b01101011,8'b01111011 :
begin
// LD dd,(nn)
MCycles = 3'b101;
case (1'b1) // MCycle
MCycle[1] :
begin
Inc_PC = 1'b1;
LDZ = 1'b1;
end
MCycle[2] :
begin
Set_Addr_To = aZI;
Inc_PC = 1'b1;
LDW = 1'b1;
end
MCycle[3] :
begin
Read_To_Reg = 1'b1;
if (IR[5:4] == 2'b11 )
begin
Set_BusA_To = 4'b1000;
end
else
begin
Set_BusA_To[2:1] = IR[5:4];
Set_BusA_To[0] = 1'b1;
end
Inc_WZ = 1'b1;
Set_Addr_To = aZI;
end // case: 4
MCycle[4] :
begin
Read_To_Reg = 1'b1;
if (IR[5:4] == 2'b11 )
begin
Set_BusA_To = 4'b1001;
end
else
begin
Set_BusA_To[2:1] = IR[5:4];
Set_BusA_To[0] = 1'b0;
end
end // case: 5
default :;
endcase // case(MCycle)
end // case: 8'b01001011,8'b01011011,8'b01101011,8'b01111011
8'b01000011,8'b01010011,8'b01100011,8'b01110011 :
begin
// LD (nn),dd
MCycles = 3'b101;
case (1'b1) // MCycle
MCycle[1] :
begin
Inc_PC = 1'b1;
LDZ = 1'b1;
end
MCycle[2] :
begin
Set_Addr_To = aZI;
Inc_PC = 1'b1;
LDW = 1'b1;
if (IR[5:4] == 2'b11 )
begin
Set_BusB_To = 4'b1000;
end
else
begin
Set_BusB_To[2:1] = IR[5:4];
Set_BusB_To[0] = 1'b1;
Set_BusB_To[3] = 1'b0;
end
end // case: 3
MCycle[3] :
begin
Inc_WZ = 1'b1;
Set_Addr_To = aZI;
Write = 1'b1;
if (IR[5:4] == 2'b11 )
begin
Set_BusB_To = 4'b1001;
end
else
begin
Set_BusB_To[2:1] = IR[5:4];
Set_BusB_To[0] = 1'b0;
Set_BusB_To[3] = 1'b0;
end
end // case: 4
MCycle[4] :
begin
Write = 1'b1;
end
default :;
endcase // case(MCycle)
end // case: 8'b01000011,8'b01010011,8'b01100011,8'b01110011
8'b10100000 , 8'b10101000 , 8'b10110000 , 8'b10111000 :
begin
// LDI, LDD, LDIR, LDDR
MCycles = 3'b100;
case (1'b1) // MCycle
MCycle[0] :
begin
Set_Addr_To = aXY;
IncDec_16 = 4'b1100; // BC
end
MCycle[1] :
begin
Set_BusB_To = 4'b0110;
Set_BusA_To[2:0] = 3'b111;
ALU_Op = 4'b0000;
Set_Addr_To = aDE;
if (IR[3] == 1'b0 )
begin
IncDec_16 = 4'b0110; // IX
end
else
begin
IncDec_16 = 4'b1110;
end
end // case: 2
MCycle[2] :
begin
I_BT = 1'b1;
TStates = 3'b101;
Write = 1'b1;
if (IR[3] == 1'b0 )
begin
IncDec_16 = 4'b0101; // DE
end
else
begin
IncDec_16 = 4'b1101;
end
end // case: 3
MCycle[3] :
begin
NoRead = 1'b1;
TStates = 3'b101;
end
default :;
endcase // case(MCycle)
end // case: 8'b10100000 , 8'b10101000 , 8'b10110000 , 8'b10111000
8'b10100001 , 8'b10101001 , 8'b10110001 , 8'b10111001 :
begin
// CPI, CPD, CPIR, CPDR
MCycles = 3'b100;
case (1'b1) // MCycle
MCycle[0] :
begin
Set_Addr_To = aXY;
IncDec_16 = 4'b1100; // BC
end
MCycle[1] :
begin
Set_BusB_To = 4'b0110;
Set_BusA_To[2:0] = 3'b111;
ALU_Op = 4'b0111;
Save_ALU = 1'b1;
PreserveC = 1'b1;
if (IR[3] == 1'b0 )
begin
IncDec_16 = 4'b0110;
end
else
begin
IncDec_16 = 4'b1110;
end
end // case: 2
MCycle[2] :
begin
NoRead = 1'b1;
I_BC = 1'b1;
TStates = 3'b101;
end
MCycle[3] :
begin
NoRead = 1'b1;
TStates = 3'b101;
end
default :;
endcase // case(MCycle)
end // case: 8'b10100001 , 8'b10101001 , 8'b10110001 , 8'b10111001
8'b01000100,8'b01001100,8'b01010100,8'b01011100,8'b01100100,8'b01101100,8'b01110100,8'b01111100 :
begin
// NEG
ALU_Op = 4'b0010;
Set_BusB_To = 4'b0111;
Set_BusA_To = 4'b1010;
Read_To_Acc = 1'b1;
Save_ALU = 1'b1;
end
8'b01000110,8'b01001110,8'b01100110,8'b01101110 :
begin
// IM 0
IMode = 2'b00;
end
8'b01010110,8'b01110110 :
// IM 1
IMode = 2'b01;
8'b01011110,8'b01110111 :
// IM 2
IMode = 2'b10;
// 16 bit arithmetic
8'b01001010,8'b01011010,8'b01101010,8'b01111010 :
begin
// ADC HL,ss
MCycles = 3'b011;
case (1'b1) // MCycle
MCycle[1] :
begin
NoRead = 1'b1;
ALU_Op = 4'b0001;
Read_To_Reg = 1'b1;
Save_ALU = 1'b1;
Set_BusA_To[2:0] = 3'b101;
case (IR[5:4])
0,1,2 :
begin
Set_BusB_To[2:1] = IR[5:4];
Set_BusB_To[0] = 1'b1;
end
default :
Set_BusB_To = 4'b1000;
endcase
TStates = 3'b100;
end // case: 2
MCycle[2] :
begin
NoRead = 1'b1;
Read_To_Reg = 1'b1;
Save_ALU = 1'b1;
ALU_Op = 4'b0001;
Set_BusA_To[2:0] = 3'b100;
case (IR[5:4])
0,1,2 :
begin
Set_BusB_To[2:1] = IR[5:4];
Set_BusB_To[0] = 1'b0;
end
default :
Set_BusB_To = 4'b1001;
endcase // case(IR[5:4])
end // case: 3
default :;
endcase // case(MCycle)
end // case: 8'b01001010,8'b01011010,8'b01101010,8'b01111010
8'b01000010,8'b01010010,8'b01100010,8'b01110010 :
begin
// SBC HL,ss
MCycles = 3'b011;
case (1'b1) // MCycle
MCycle[1] :
begin
NoRead = 1'b1;
ALU_Op = 4'b0011;
Read_To_Reg = 1'b1;
Save_ALU = 1'b1;
Set_BusA_To[2:0] = 3'b101;
case (IR[5:4])
0,1,2 :
begin
Set_BusB_To[2:1] = IR[5:4];
Set_BusB_To[0] = 1'b1;
end
default :
Set_BusB_To = 4'b1000;
endcase
TStates = 3'b100;
end // case: 2
MCycle[2] :
begin
NoRead = 1'b1;
ALU_Op = 4'b0011;
Read_To_Reg = 1'b1;
Save_ALU = 1'b1;
Set_BusA_To[2:0] = 3'b100;
case (IR[5:4])
0,1,2 :
Set_BusB_To[2:1] = IR[5:4];
default :
Set_BusB_To = 4'b1001;
endcase
end // case: 3
default :;
endcase // case(MCycle)
end // case: 8'b01000010,8'b01010010,8'b01100010,8'b01110010
8'b01101111 :
begin
// RLD
MCycles = 3'b100;
case (1'b1) // MCycle
MCycle[1] :
begin
NoRead = 1'b1;
Set_Addr_To = aXY;
end
MCycle[2] :
begin
Read_To_Reg = 1'b1;
Set_BusB_To[2:0] = 3'b110;
Set_BusA_To[2:0] = 3'b111;
ALU_Op = 4'b1101;
TStates = 3'b100;
Set_Addr_To = aXY;
Save_ALU = 1'b1;
end
MCycle[3] :
begin
I_RLD = 1'b1;
Write = 1'b1;
end
default :;
endcase // case(MCycle)
end // case: 8'b01101111
8'b01100111 :
begin
// RRD
MCycles = 3'b100;
case (1'b1) // MCycle
MCycle[1] :
Set_Addr_To = aXY;
MCycle[2] :
begin
Read_To_Reg = 1'b1;
Set_BusB_To[2:0] = 3'b110;
Set_BusA_To[2:0] = 3'b111;
ALU_Op = 4'b1110;
TStates = 3'b100;
Set_Addr_To = aXY;
Save_ALU = 1'b1;
end
MCycle[3] :
begin
I_RRD = 1'b1;
Write = 1'b1;
end
default :;
endcase // case(MCycle)
end // case: 8'b01100111
8'b01000101,8'b01001101,8'b01010101,8'b01011101,8'b01100101,8'b01101101,8'b01110101,8'b01111101 :
begin
// RETI, RETN
MCycles = 3'b011;
case (1'b1) // MCycle
MCycle[0] :
Set_Addr_To = aSP;
MCycle[1] :
begin
IncDec_16 = 4'b0111;
Set_Addr_To = aSP;
LDZ = 1'b1;
end
MCycle[2] :
begin
Jump = 1'b1;
IncDec_16 = 4'b0111;
I_RETN = 1'b1;
end
default :;
endcase // case(MCycle)
end // case: 8'b01000101,8'b01001101,8'b01010101,8'b01011101,8'b01100101,8'b01101101,8'b01110101,8'b01111101
8'b01000000,8'b01001000,8'b01010000,8'b01011000,8'b01100000,8'b01101000,8'b01110000,8'b01111000 :
begin
// IN r,(C)
MCycles = 3'b010;
case (1'b1) // MCycle
MCycle[0] :
Set_Addr_To = aBC;
MCycle[1] :
begin
IORQ = 1'b1;
if (IR[5:3] != 3'b110 )
begin
Read_To_Reg = 1'b1;
Set_BusA_To[2:0] = IR[5:3];
end
I_INRC = 1'b1;
end
default :;
endcase // case(MCycle)
end // case: 8'b01000000,8'b01001000,8'b01010000,8'b01011000,8'b01100000,8'b01101000,8'b01110000,8'b01111000
8'b01000001,8'b01001001,8'b01010001,8'b01011001,8'b01100001,8'b01101001,8'b01110001,8'b01111001 :
begin
// OUT (C),r
// OUT (C),0
MCycles = 3'b010;
case (1'b1) // MCycle
MCycle[0] :
begin
Set_Addr_To = aBC;
Set_BusB_To[2:0] = IR[5:3];
if (IR[5:3] == 3'b110 )
begin
Set_BusB_To[3] = 1'b1;
end
end
MCycle[1] :
begin
Write = 1'b1;
IORQ = 1'b1;
end
default :;
endcase // case(MCycle)
end // case: 8'b01000001,8'b01001001,8'b01010001,8'b01011001,8'b01100001,8'b01101001,8'b01110001,8'b01111001
8'b10100010 , 8'b10101010 , 8'b10110010 , 8'b10111010 :
begin
// INI, IND, INIR, INDR
MCycles = 3'b100;
case (1'b1) // MCycle
MCycle[0] :
begin
Set_Addr_To = aBC;
Set_BusB_To = 4'b1010;
Set_BusA_To = 4'b0000;
Read_To_Reg = 1'b1;
Save_ALU = 1'b1;
ALU_Op = 4'b0010;
end
MCycle[1] :
begin
IORQ = 1'b1;
Set_BusB_To = 4'b0110;
Set_Addr_To = aXY;
end
MCycle[2] :
begin
if (IR[3] == 1'b0 )
begin
IncDec_16 = 4'b0110;
end
else
begin
IncDec_16 = 4'b1110;
end
TStates = 3'b100;
Write = 1'b1;
I_BTR = 1'b1;
end // case: 3
MCycle[3] :
begin
NoRead = 1'b1;
TStates = 3'b101;
end
default :;
endcase // case(MCycle)
end // case: 8'b10100010 , 8'b10101010 , 8'b10110010 , 8'b10111010
8'b10100011 , 8'b10101011 , 8'b10110011 , 8'b10111011 :
begin
// OUTI, OUTD, OTIR, OTDR
MCycles = 3'b100;
case (1'b1) // MCycle
MCycle[0] :
begin
TStates = 3'b101;
Set_Addr_To = aXY;
Set_BusB_To = 4'b1010;
Set_BusA_To = 4'b0000;
Read_To_Reg = 1'b1;
Save_ALU = 1'b1;
ALU_Op = 4'b0010;
end
MCycle[1] :
begin
Set_BusB_To = 4'b0110;
Set_Addr_To = aBC;
if (IR[3] == 1'b0 )
begin
IncDec_16 = 4'b0110;
end
else
begin
IncDec_16 = 4'b1110;
end
end
MCycle[2] :
begin
if (IR[3] == 1'b0 )
begin
IncDec_16 = 4'b0010;
end
else
begin
IncDec_16 = 4'b1010;
end
IORQ = 1'b1;
Write = 1'b1;
I_BTR = 1'b1;
end // case: 3
MCycle[3] :
begin
NoRead = 1'b1;
TStates = 3'b101;
end
default :;
endcase // case(MCycle)
end // case: 8'b10100011 , 8'b10101011 , 8'b10110011 , 8'b10111011
 
default : ;
endcase // case(IR)
end // block: default_ed_block
endcase // case(ISet)
if (Mode == 1 )
begin
if (MCycle[0] )
begin
//TStates = 3'b100;
end
else
begin
TStates = 3'b011;
end
end
 
if (Mode == 3 )
begin
if (MCycle[0] )
begin
//TStates = 3'b100;
end
else
begin
TStates = 3'b100;
end
end
 
if (Mode < 2 )
begin
if (MCycle[5] )
begin
Inc_PC = 1'b1;
if (Mode == 1 )
begin
Set_Addr_To = aXY;
TStates = 3'b100;
Set_BusB_To[2:0] = SSS;
Set_BusB_To[3] = 1'b0;
end
if (IR == 8'b00110110 || IR == 8'b11001011 )
begin
Set_Addr_To = aNone;
end
end
if (MCycle[6] )
begin
if (Mode == 0 )
begin
TStates = 3'b101;
end
if (ISet != 2'b01 )
begin
Set_Addr_To = aXY;
end
Set_BusB_To[2:0] = SSS;
Set_BusB_To[3] = 1'b0;
if (IR == 8'b00110110 || ISet == 2'b01 )
begin
// LD (HL),n
Inc_PC = 1'b1;
end
else
begin
NoRead = 1'b1;
end
end
end // if (Mode < 2 )
end // always @ (IR, ISet, MCycle, F, NMICycle, IntCycle)
endmodule // T80_MCode
/zx_ula/branches/xilinx/spectrum_48k_for_digilent_spartan3_starter_kit_with_ps2_keyboard/mapa_es.inc
0,0 → 1,360
// Teclas con scancode simple
`define KEY_ESC 8'h76
`define KEY_F1 8'h05
`define KEY_F2 8'h06
`define KEY_F3 8'h04
`define KEY_F4 8'h0C
`define KEY_F5 8'h03
`define KEY_F6 8'h0B
`define KEY_F7 8'h83
`define KEY_F8 8'h0A
`define KEY_F9 8'h01
`define KEY_F10 8'h09
`define KEY_F11 8'h78
`define KEY_F12 8'h07
 
`define KEY_BL 8'h0E
`define KEY_1 8'h16
`define KEY_2 8'h1E
`define KEY_3 8'h26
`define KEY_4 8'h25
`define KEY_5 8'h2E
`define KEY_6 8'h36
`define KEY_7 8'h3D
`define KEY_8 8'h3E
`define KEY_9 8'h46
`define KEY_0 8'h45
`define KEY_APOS 8'h4E
`define KEY_AEXC 8'h55
`define KEY_BKSP 8'h66
 
`define KEY_TAB 8'h0D
`define KEY_Q 8'h15
`define KEY_W 8'h1D
`define KEY_E 8'h24
`define KEY_R 8'h2D
`define KEY_T 8'h2C
`define KEY_Y 8'h35
`define KEY_U 8'h3C
`define KEY_I 8'h43
`define KEY_O 8'h44
`define KEY_P 8'h4D
`define KEY_CORCHA 8'h54
`define KEY_CORCHC 8'h5B
`define KEY_ENTER 8'h5A
 
`define KEY_CPSLK 8'h58
`define KEY_A 8'h1C
`define KEY_S 8'h1B
`define KEY_D 8'h23
`define KEY_F 8'h2B
`define KEY_G 8'h34
`define KEY_H 8'h33
`define KEY_J 8'h3B
`define KEY_K 8'h42
`define KEY_L 8'h4B
`define KEY_NT 8'h4C
`define KEY_LLAVA 8'h52
`define KEY_LLAVC 8'h5D
 
`define KEY_LSHIFT 8'h12
`define KEY_LT 8'h61
`define KEY_Z 8'h1A
`define KEY_X 8'h22
`define KEY_C 8'h21
`define KEY_V 8'h2A
`define KEY_B 8'h32
`define KEY_N 8'h31
`define KEY_M 8'h3A
`define KEY_COMA 8'h41
`define KEY_PUNTO 8'h49
`define KEY_MENOS 8'h4A
`define KEY_RSHIFT 8'h59
 
`define KEY_CTRLI 8'h14
`define KEY_ALTI 8'h11
`define KEY_SPACE 8'h29
 
`define KEY_KP0 8'h70
`define KEY_KP1 8'h69
`define KEY_KP2 8'h72
`define KEY_KP3 8'h7A
`define KEY_KP4 8'h6B
`define KEY_KP5 8'h73
`define KEY_KP6 8'h74
`define KEY_KP7 8'h6C
`define KEY_KP8 8'h75
`define KEY_KP9 8'h7D
`define KEY_KPPUNTO 8'h71
`define KEY_KPMAS 8'h79
`define KEY_KPMENOS 8'h7B
`define KEY_KPASTER 8'h7C
 
`define KEY_BLKNUM 8'h77
`define KEY_BLKSCR 8'h7E
 
// Teclas con E0 + scancode
`define KEY_WAKEUP 8'h5E
`define KEY_SLEEP 8'h3F
`define KEY_POWER 8'h37
`define KEY_INS 8'h70
`define KEY_SUP 8'h71
`define KEY_HOME 8'h6C
`define KEY_END 8'h69
`define KEY_PGU 8'h7D
`define KEY_PGD 8'h7A
`define KEY_UP 8'h75
`define KEY_DOWN 8'h72
`define KEY_LEFT 8'h6B
`define KEY_RIGHT 8'h74
`define KEY_CTRLD 8'h14
`define KEY_ALTGR 8'h11
`define KEY_KPENTER 8'h5A
`define KEY_KPSLASH 8'h4A
`define KEY_PRTSCR 8'h7C
 
// Matriz del ZX Spectrum
`define SP_CS {3'b000,5'b11110}
`define SP_Z {3'b000,5'b11101}
`define SP_X {3'b000,5'b11011}
`define SP_C {3'b000,5'b10111}
`define SP_V {3'b000,5'b01111}
 
`define SP_A {3'b001,5'b11110}
`define SP_S {3'b001,5'b11101}
`define SP_D {3'b001,5'b11011}
`define SP_F {3'b001,5'b10111}
`define SP_G {3'b001,5'b01111}
 
`define SP_Q {3'b010,5'b11110}
`define SP_W {3'b010,5'b11101}
`define SP_E {3'b010,5'b11011}
`define SP_R {3'b010,5'b10111}
`define SP_T {3'b010,5'b01111}
 
`define SP_1 {3'b011,5'b11110}
`define SP_2 {3'b011,5'b11101}
`define SP_3 {3'b011,5'b11011}
`define SP_4 {3'b011,5'b10111}
`define SP_5 {3'b011,5'b01111}
 
`define SP_0 {3'b100,5'b11110}
`define SP_9 {3'b100,5'b11101}
`define SP_8 {3'b100,5'b11011}
`define SP_7 {3'b100,5'b10111}
`define SP_6 {3'b100,5'b01111}
 
`define SP_P {3'b101,5'b11110}
`define SP_O {3'b101,5'b11101}
`define SP_I {3'b101,5'b11011}
`define SP_U {3'b101,5'b10111}
`define SP_Y {3'b101,5'b01111}
 
`define SP_ENT {3'b110,5'b11110}
`define SP_L {3'b110,5'b11101}
`define SP_K {3'b110,5'b11011}
`define SP_J {3'b110,5'b10111}
`define SP_H {3'b110,5'b01111}
 
`define SP_SPC {3'b111,5'b11110}
`define SP_SS {3'b111,5'b11101}
`define SP_M {3'b111,5'b11011}
`define SP_N {3'b111,5'b10111}
`define SP_B {3'b111,5'b01111}
 
`define SP_NOKEY {3'b111,5'b11111}
`define NADA {`SP_NOKEY,`SP_NOKEY}
 
integer relleno;
initial begin
 
for (relleno=0;relleno<=131; relleno=relleno+1)
begin
mapa_noshift_noext[relleno]={`NADA};
mapa_noshift_ext[relleno]={`NADA};
mapa_shift_noext[relleno]={`NADA};
mapa_shift_ext[relleno]={`NADA};
end
 
 
/* TRADUCCION DE TECLAS SIN SHIFT PULSADO */
 
// Fila de teclas de funcion (13 teclas)
mapa_noshift_noext[`KEY_ESC] ={`SP_CS,`SP_SPC};
mapa_noshift_noext[`KEY_F2] ={`SP_CS,`SP_1};
 
 
mapa_noshift_noext[`KEY_BL] ={`SP_SS,`SP_D};
mapa_noshift_noext[`KEY_1] ={`SP_1,`SP_NOKEY};
mapa_noshift_noext[`KEY_2] ={`SP_2,`SP_NOKEY};
mapa_noshift_noext[`KEY_3] ={`SP_3,`SP_NOKEY};
mapa_noshift_noext[`KEY_4] ={`SP_4,`SP_NOKEY};
mapa_noshift_noext[`KEY_5] ={`SP_5,`SP_NOKEY};
mapa_noshift_noext[`KEY_6] ={`SP_6,`SP_NOKEY};
mapa_noshift_noext[`KEY_7] ={`SP_7,`SP_NOKEY};
mapa_noshift_noext[`KEY_8] ={`SP_8,`SP_NOKEY};
mapa_noshift_noext[`KEY_9] ={`SP_9,`SP_NOKEY};
mapa_noshift_noext[`KEY_0] ={`SP_0,`SP_NOKEY};
mapa_noshift_noext[`KEY_APOS] ={`SP_SS,`SP_7};
mapa_noshift_noext[`KEY_BKSP] ={`SP_CS,`SP_0};
// Fila Q-P (14 teclas)
mapa_noshift_noext[`KEY_TAB] ={`SP_CS,`SP_SS};
mapa_noshift_noext[`KEY_Q] ={`SP_Q,`SP_NOKEY};
mapa_noshift_noext[`KEY_W] ={`SP_W,`SP_NOKEY};
mapa_noshift_noext[`KEY_E] ={`SP_E,`SP_NOKEY};
mapa_noshift_noext[`KEY_R] ={`SP_R,`SP_NOKEY};
mapa_noshift_noext[`KEY_T] ={`SP_T,`SP_NOKEY};
mapa_noshift_noext[`KEY_Y] ={`SP_Y,`SP_NOKEY};
mapa_noshift_noext[`KEY_U] ={`SP_U,`SP_NOKEY};
mapa_noshift_noext[`KEY_I] ={`SP_I,`SP_NOKEY};
mapa_noshift_noext[`KEY_O] ={`SP_O,`SP_NOKEY};
mapa_noshift_noext[`KEY_P] ={`SP_P,`SP_NOKEY};
mapa_noshift_noext[`KEY_CORCHA]={`SP_SS,`SP_H};
mapa_noshift_noext[`KEY_CORCHC]={`SP_SS,`SP_K};
mapa_noshift_noext[`KEY_ENTER]={`SP_ENT,`SP_NOKEY};
 
// Fila A-L (13 teclas)
mapa_noshift_noext[`KEY_CPSLK]={`SP_CS,`SP_2};
mapa_noshift_noext[`KEY_A] ={`SP_A,`SP_NOKEY};
mapa_noshift_noext[`KEY_S] ={`SP_S,`SP_NOKEY};
mapa_noshift_noext[`KEY_D] ={`SP_D,`SP_NOKEY};
mapa_noshift_noext[`KEY_F] ={`SP_F,`SP_NOKEY};
mapa_noshift_noext[`KEY_G] ={`SP_G,`SP_NOKEY};
mapa_noshift_noext[`KEY_H] ={`SP_H,`SP_NOKEY};
mapa_noshift_noext[`KEY_J] ={`SP_J,`SP_NOKEY};
mapa_noshift_noext[`KEY_K] ={`SP_K,`SP_NOKEY};
mapa_noshift_noext[`KEY_L] ={`SP_L,`SP_NOKEY};
mapa_noshift_noext[`KEY_LLAVA]={`SP_SS,`SP_F};
mapa_noshift_noext[`KEY_LLAVC]={`SP_SS,`SP_P};
// Fila Z-M (13 teclas)
mapa_noshift_noext[`KEY_LT] ={`SP_SS,`SP_R};
mapa_noshift_noext[`KEY_Z] ={`SP_Z,`SP_NOKEY};
mapa_noshift_noext[`KEY_X] ={`SP_X,`SP_NOKEY};
mapa_noshift_noext[`KEY_C] ={`SP_C,`SP_NOKEY};
mapa_noshift_noext[`KEY_V] ={`SP_V,`SP_NOKEY};
mapa_noshift_noext[`KEY_B] ={`SP_B,`SP_NOKEY};
mapa_noshift_noext[`KEY_N] ={`SP_N,`SP_NOKEY};
mapa_noshift_noext[`KEY_M] ={`SP_M,`SP_NOKEY};
mapa_noshift_noext[`KEY_COMA] ={`SP_SS,`SP_N};
mapa_noshift_noext[`KEY_PUNTO]={`SP_SS,`SP_M};
mapa_noshift_noext[`KEY_MENOS]={`SP_SS,`SP_J};
// Fila CTRL-SPACE (3 teclas)
mapa_noshift_noext[`KEY_CTRLI]={`SP_CS,`SP_NOKEY};
mapa_noshift_noext[`KEY_SPACE]={`SP_SPC,`SP_NOKEY};
// Keypad (14 teclas)
mapa_noshift_noext[`KEY_KP0] ={`SP_0,`SP_NOKEY};
mapa_noshift_noext[`KEY_KP1] ={`SP_1,`SP_NOKEY};
mapa_noshift_noext[`KEY_KP2] ={`SP_2,`SP_NOKEY};
mapa_noshift_noext[`KEY_KP3] ={`SP_3,`SP_NOKEY};
mapa_noshift_noext[`KEY_KP4] ={`SP_4,`SP_NOKEY};
mapa_noshift_noext[`KEY_KP5] ={`SP_5,`SP_NOKEY};
mapa_noshift_noext[`KEY_KP6] ={`SP_6,`SP_NOKEY};
mapa_noshift_noext[`KEY_KP7] ={`SP_7,`SP_NOKEY};
mapa_noshift_noext[`KEY_KP8] ={`SP_8,`SP_NOKEY};
mapa_noshift_noext[`KEY_KP9] ={`SP_9,`SP_NOKEY};
mapa_noshift_noext[`KEY_KPPUNTO] ={`SP_SS,`SP_M};
mapa_noshift_noext[`KEY_KPMAS] ={`SP_SS,`SP_K};
mapa_noshift_noext[`KEY_KPMENOS] ={`SP_SS,`SP_J};
mapa_noshift_noext[`KEY_KPASTER] ={`SP_SS,`SP_B};
 
 
/* TRADUCCION DE TECLAS CON SHIFT PULSADO */
 
// Fila de teclas de funcion (13 teclas)
mapa_shift_noext[`KEY_ESC] ={`SP_CS,`SP_SPC};
mapa_shift_noext[`KEY_F2] ={`SP_CS,`SP_1};
 
 
mapa_shift_noext[`KEY_1] ={`SP_1,`SP_SS};
mapa_shift_noext[`KEY_2] ={`SP_P,`SP_SS};
mapa_shift_noext[`KEY_3] ={`SP_3,`SP_SS};
mapa_shift_noext[`KEY_4] ={`SP_4,`SP_SS};
mapa_shift_noext[`KEY_5] ={`SP_5,`SP_SS};
mapa_shift_noext[`KEY_6] ={`SP_6,`SP_SS};
mapa_shift_noext[`KEY_7] ={`SP_V,`SP_SS};
mapa_shift_noext[`KEY_8] ={`SP_8,`SP_SS};
mapa_shift_noext[`KEY_9] ={`SP_9,`SP_SS};
mapa_shift_noext[`KEY_0] ={`SP_L,`SP_SS};
mapa_shift_noext[`KEY_APOS] ={`SP_C,`SP_SS};
mapa_shift_noext[`KEY_BKSP] ={`SP_CS,`SP_0};
// Fila Q-P (14 teclas)
mapa_shift_noext[`KEY_TAB] ={`SP_CS,`SP_SS};
mapa_shift_noext[`KEY_Q] ={`SP_Q,`SP_CS};
mapa_shift_noext[`KEY_W] ={`SP_W,`SP_CS};
mapa_shift_noext[`KEY_E] ={`SP_E,`SP_CS};
mapa_shift_noext[`KEY_R] ={`SP_R,`SP_CS};
mapa_shift_noext[`KEY_T] ={`SP_T,`SP_CS};
mapa_shift_noext[`KEY_Y] ={`SP_Y,`SP_CS};
mapa_shift_noext[`KEY_U] ={`SP_U,`SP_CS};
mapa_shift_noext[`KEY_I] ={`SP_I,`SP_CS};
mapa_shift_noext[`KEY_O] ={`SP_O,`SP_CS};
mapa_shift_noext[`KEY_P] ={`SP_P,`SP_CS};
mapa_shift_noext[`KEY_CORCHA] ={`SP_SS,`SP_H};
mapa_shift_noext[`KEY_CORCHC] ={`SP_SS,`SP_B};
mapa_shift_noext[`KEY_ENTER] ={`SP_ENT,`SP_NOKEY};
 
// Fila A-L (13 teclas)
mapa_shift_noext[`KEY_CPSLK] ={`SP_CS,`SP_2};
mapa_shift_noext[`KEY_A] ={`SP_A,`SP_CS};
mapa_shift_noext[`KEY_S] ={`SP_S,`SP_CS};
mapa_shift_noext[`KEY_D] ={`SP_D,`SP_CS};
mapa_shift_noext[`KEY_F] ={`SP_F,`SP_CS};
mapa_shift_noext[`KEY_G] ={`SP_G,`SP_CS};
mapa_shift_noext[`KEY_H] ={`SP_H,`SP_CS};
mapa_shift_noext[`KEY_J] ={`SP_J,`SP_CS};
mapa_shift_noext[`KEY_K] ={`SP_K,`SP_CS};
mapa_shift_noext[`KEY_L] ={`SP_L,`SP_CS};
mapa_shift_noext[`KEY_LLAVA] ={`SP_SS,`SP_F};
mapa_shift_noext[`KEY_LLAVC] ={`SP_SS,`SP_G};
// Fila Z-M (13 teclas)
mapa_shift_noext[`KEY_LT] ={`SP_SS,`SP_T};
mapa_shift_noext[`KEY_Z] ={`SP_Z,`SP_CS};
mapa_shift_noext[`KEY_X] ={`SP_X,`SP_CS};
mapa_shift_noext[`KEY_C] ={`SP_C,`SP_CS};
mapa_shift_noext[`KEY_V] ={`SP_V,`SP_CS};
mapa_shift_noext[`KEY_B] ={`SP_B,`SP_CS};
mapa_shift_noext[`KEY_N] ={`SP_N,`SP_CS};
mapa_shift_noext[`KEY_M] ={`SP_M,`SP_CS};
mapa_shift_noext[`KEY_COMA] ={`SP_SS,`SP_O};
mapa_shift_noext[`KEY_PUNTO]={`SP_SS,`SP_Z};
mapa_shift_noext[`KEY_MENOS]={`SP_SS,`SP_0};
// Fila CTRL-SPACE (3 teclas)
mapa_shift_noext[`KEY_CTRLI]={`SP_CS,`SP_NOKEY};
mapa_shift_noext[`KEY_SPACE]={`SP_SPC,`SP_NOKEY};
// Keypad (14 teclas)
mapa_shift_noext[`KEY_KP0] ={`SP_0,`SP_NOKEY};
mapa_shift_noext[`KEY_KP1] ={`SP_1,`SP_NOKEY};
mapa_shift_noext[`KEY_KP2] ={`SP_2,`SP_NOKEY};
mapa_shift_noext[`KEY_KP3] ={`SP_3,`SP_NOKEY};
mapa_shift_noext[`KEY_KP4] ={`SP_4,`SP_NOKEY};
mapa_shift_noext[`KEY_KP5] ={`SP_5,`SP_NOKEY};
mapa_shift_noext[`KEY_KP6] ={`SP_6,`SP_NOKEY};
mapa_shift_noext[`KEY_KP7] ={`SP_7,`SP_NOKEY};
mapa_shift_noext[`KEY_KP8] ={`SP_8,`SP_NOKEY};
mapa_shift_noext[`KEY_KP9] ={`SP_9,`SP_NOKEY};
mapa_shift_noext[`KEY_KPPUNTO] ={`SP_SS,`SP_M};
mapa_shift_noext[`KEY_KPMAS] ={`SP_SS,`SP_K};
mapa_shift_noext[`KEY_KPMENOS] ={`SP_SS,`SP_J};
mapa_shift_noext[`KEY_KPASTER] ={`SP_SS,`SP_B};
 
 
/* TRADUCCION DE TECLAS EXTENDIDAS SIN SHIFT PULSADO */
 
mapa_noshift_ext[`KEY_UP] ={`SP_7,`SP_CS};
mapa_noshift_ext[`KEY_DOWN] ={`SP_6,`SP_CS};
mapa_noshift_ext[`KEY_LEFT] ={`SP_5,`SP_CS};
mapa_noshift_ext[`KEY_RIGHT] ={`SP_8,`SP_CS};
mapa_noshift_ext[`KEY_CTRLD] ={`SP_SS,`SP_NOKEY};
mapa_noshift_ext[`KEY_KPENTER] ={`SP_ENT,`SP_NOKEY};
mapa_noshift_ext[`KEY_KPSLASH] ={`SP_V,`SP_SS};
 
end
 
/zx_ula/branches/xilinx/spectrum_48k_for_digilent_spartan3_starter_kit_with_ps2_keyboard/tv80_core.v
0,0 → 1,1389
//
// TV80 8-Bit Microprocessor Core
// Based on the VHDL T80 core by Daniel Wallner (jesus@opencores.org)
//
// Copyright (c) 2004 Guy Hutchison (ghutchis@opencores.org)
//
// Permission is hereby granted, free of charge, to any person obtaining a
// copy of this software and associated documentation files (the "Software"),
// to deal in the Software without restriction, including without limitation
// the rights to use, copy, modify, merge, publish, distribute, sublicense,
// and/or sell copies of the Software, and to permit persons to whom the
// Software is furnished to do so, subject to the following conditions:
//
// The above copyright notice and this permission notice shall be included
// in all copies or substantial portions of the Software.
//
// THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND,
// EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF
// MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT.
// IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY
// CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT,
// TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE
// SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
 
module tv80_core (/*AUTOARG*/
// Outputs
m1_n, iorq, no_read, write, rfsh_n, halt_n, busak_n, A, dout, mc,
ts, intcycle_n, IntE, stop,
// Inputs
reset_n, clk, cen, wait_n, int_n, nmi_n, busrq_n, dinst, di
);
// Beginning of automatic inputs (from unused autoinst inputs)
// End of automatics
parameter Mode = 1; // 0 => Z80, 1 => Fast Z80, 2 => 8080, 3 => GB
parameter IOWait = 1; // 0 => Single cycle I/O, 1 => Std I/O cycle
parameter Flag_C = 0;
parameter Flag_N = 1;
parameter Flag_P = 2;
parameter Flag_X = 3;
parameter Flag_H = 4;
parameter Flag_Y = 5;
parameter Flag_Z = 6;
parameter Flag_S = 7;
 
input reset_n;
input clk;
input cen;
input wait_n;
input int_n;
input nmi_n;
input busrq_n;
output m1_n;
output iorq;
output no_read;
output write;
output rfsh_n;
output halt_n;
output busak_n;
output [15:0] A;
input [7:0] dinst;
input [7:0] di;
output [7:0] dout;
output [6:0] mc;
output [6:0] ts;
output intcycle_n;
output IntE;
output stop;
 
reg m1_n;
reg iorq;
`ifdef TV80_REFRESH
reg rfsh_n;
`endif
reg halt_n;
reg busak_n;
reg [15:0] A;
reg [7:0] dout;
reg [6:0] mc;
reg [6:0] ts;
reg intcycle_n;
reg IntE;
reg stop;
 
parameter aNone = 3'b111;
parameter aBC = 3'b000;
parameter aDE = 3'b001;
parameter aXY = 3'b010;
parameter aIOA = 3'b100;
parameter aSP = 3'b101;
parameter aZI = 3'b110;
 
// Registers
reg [7:0] ACC, F;
reg [7:0] Ap, Fp;
reg [7:0] I;
`ifdef TV80_REFRESH
reg [7:0] R;
`endif
reg [15:0] SP, PC;
reg [7:0] RegDIH;
reg [7:0] RegDIL;
wire [15:0] RegBusA;
wire [15:0] RegBusB;
wire [15:0] RegBusC;
reg [2:0] RegAddrA_r;
reg [2:0] RegAddrA;
reg [2:0] RegAddrB_r;
reg [2:0] RegAddrB;
reg [2:0] RegAddrC;
reg RegWEH;
reg RegWEL;
reg Alternate;
 
// Help Registers
reg [15:0] TmpAddr; // Temporary address register
reg [7:0] IR; // Instruction register
reg [1:0] ISet; // Instruction set selector
reg [15:0] RegBusA_r;
 
reg [15:0] ID16;
reg [7:0] Save_Mux;
 
reg [6:0] tstate;
reg [6:0] mcycle;
reg last_mcycle, last_tstate;
reg IntE_FF1;
reg IntE_FF2;
reg Halt_FF;
reg BusReq_s;
reg BusAck;
reg ClkEn;
reg NMI_s;
reg INT_s;
reg [1:0] IStatus;
 
reg [7:0] DI_Reg;
reg T_Res;
reg [1:0] XY_State;
reg [2:0] Pre_XY_F_M;
reg NextIs_XY_Fetch;
reg XY_Ind;
reg No_BTR;
reg BTR_r;
reg Auto_Wait;
reg Auto_Wait_t1;
reg Auto_Wait_t2;
reg IncDecZ;
 
// ALU signals
reg [7:0] BusB;
reg [7:0] BusA;
wire [7:0] ALU_Q;
wire [7:0] F_Out;
 
// Registered micro code outputs
reg [4:0] Read_To_Reg_r;
reg Arith16_r;
reg Z16_r;
reg [3:0] ALU_Op_r;
reg Save_ALU_r;
reg PreserveC_r;
reg [2:0] mcycles;
 
// Micro code outputs
wire [2:0] mcycles_d;
wire [2:0] tstates;
reg IntCycle;
reg NMICycle;
wire Inc_PC;
wire Inc_WZ;
wire [3:0] IncDec_16;
wire [1:0] Prefix;
wire Read_To_Acc;
wire Read_To_Reg;
wire [3:0] Set_BusB_To;
wire [3:0] Set_BusA_To;
wire [3:0] ALU_Op;
wire Save_ALU;
wire PreserveC;
wire Arith16;
wire [2:0] Set_Addr_To;
wire Jump;
wire JumpE;
wire JumpXY;
wire Call;
wire RstP;
wire LDZ;
wire LDW;
wire LDSPHL;
wire iorq_i;
wire [2:0] Special_LD;
wire ExchangeDH;
wire ExchangeRp;
wire ExchangeAF;
wire ExchangeRS;
wire I_DJNZ;
wire I_CPL;
wire I_CCF;
wire I_SCF;
wire I_RETN;
wire I_BT;
wire I_BC;
wire I_BTR;
wire I_RLD;
wire I_RRD;
wire I_INRC;
wire SetDI;
wire SetEI;
wire [1:0] IMode;
wire Halt;
 
reg [15:0] PC16;
reg [15:0] PC16_B;
reg [15:0] SP16, SP16_A, SP16_B;
reg [15:0] ID16_B;
reg Oldnmi_n;
tv80_mcode #(Mode, Flag_C, Flag_N, Flag_P, Flag_X, Flag_H, Flag_Y, Flag_Z, Flag_S) i_mcode
(
.IR (IR),
.ISet (ISet),
.MCycle (mcycle),
.F (F),
.NMICycle (NMICycle),
.IntCycle (IntCycle),
.MCycles (mcycles_d),
.TStates (tstates),
.Prefix (Prefix),
.Inc_PC (Inc_PC),
.Inc_WZ (Inc_WZ),
.IncDec_16 (IncDec_16),
.Read_To_Acc (Read_To_Acc),
.Read_To_Reg (Read_To_Reg),
.Set_BusB_To (Set_BusB_To),
.Set_BusA_To (Set_BusA_To),
.ALU_Op (ALU_Op),
.Save_ALU (Save_ALU),
.PreserveC (PreserveC),
.Arith16 (Arith16),
.Set_Addr_To (Set_Addr_To),
.IORQ (iorq_i),
.Jump (Jump),
.JumpE (JumpE),
.JumpXY (JumpXY),
.Call (Call),
.RstP (RstP),
.LDZ (LDZ),
.LDW (LDW),
.LDSPHL (LDSPHL),
.Special_LD (Special_LD),
.ExchangeDH (ExchangeDH),
.ExchangeRp (ExchangeRp),
.ExchangeAF (ExchangeAF),
.ExchangeRS (ExchangeRS),
.I_DJNZ (I_DJNZ),
.I_CPL (I_CPL),
.I_CCF (I_CCF),
.I_SCF (I_SCF),
.I_RETN (I_RETN),
.I_BT (I_BT),
.I_BC (I_BC),
.I_BTR (I_BTR),
.I_RLD (I_RLD),
.I_RRD (I_RRD),
.I_INRC (I_INRC),
.SetDI (SetDI),
.SetEI (SetEI),
.IMode (IMode),
.Halt (Halt),
.NoRead (no_read),
.Write (write)
);
 
tv80_alu #(Mode, Flag_C, Flag_N, Flag_P, Flag_X, Flag_H, Flag_Y, Flag_Z, Flag_S) i_alu
(
.Arith16 (Arith16_r),
.Z16 (Z16_r),
.ALU_Op (ALU_Op_r),
.IR (IR[5:0]),
.ISet (ISet),
.BusA (BusA),
.BusB (BusB),
.F_In (F),
.Q (ALU_Q),
.F_Out (F_Out)
);
 
function [6:0] number_to_bitvec;
input [2:0] num;
begin
case (num)
1 : number_to_bitvec = 7'b0000001;
2 : number_to_bitvec = 7'b0000010;
3 : number_to_bitvec = 7'b0000100;
4 : number_to_bitvec = 7'b0001000;
5 : number_to_bitvec = 7'b0010000;
6 : number_to_bitvec = 7'b0100000;
7 : number_to_bitvec = 7'b1000000;
default : number_to_bitvec = 7'bx;
endcase // case(num)
end
endfunction // number_to_bitvec
 
function [2:0] mcyc_to_number;
input [6:0] mcyc;
begin
casez (mcyc)
7'b1zzzzzz : mcyc_to_number = 3'h7;
7'b01zzzzz : mcyc_to_number = 3'h6;
7'b001zzzz : mcyc_to_number = 3'h5;
7'b0001zzz : mcyc_to_number = 3'h4;
7'b00001zz : mcyc_to_number = 3'h3;
7'b000001z : mcyc_to_number = 3'h2;
7'b0000001 : mcyc_to_number = 3'h1;
default : mcyc_to_number = 3'h1;
endcase
end
endfunction
always @(/*AUTOSENSE*/mcycle or mcycles or tstate or tstates)
begin
case (mcycles)
1 : last_mcycle = mcycle[0];
2 : last_mcycle = mcycle[1];
3 : last_mcycle = mcycle[2];
4 : last_mcycle = mcycle[3];
5 : last_mcycle = mcycle[4];
6 : last_mcycle = mcycle[5];
7 : last_mcycle = mcycle[6];
default : last_mcycle = 1'bx;
endcase // case(mcycles)
 
case (tstates)
0 : last_tstate = tstate[0];
1 : last_tstate = tstate[1];
2 : last_tstate = tstate[2];
3 : last_tstate = tstate[3];
4 : last_tstate = tstate[4];
5 : last_tstate = tstate[5];
6 : last_tstate = tstate[6];
default : last_tstate = 1'bx;
endcase
end // always @ (...
always @(/*AUTOSENSE*/ALU_Q or BusAck or BusB or DI_Reg
or ExchangeRp or IR or Save_ALU_r or Set_Addr_To or XY_Ind
or XY_State or cen or last_tstate or mcycle)
begin
ClkEn = cen && ~ BusAck;
 
if (last_tstate)
T_Res = 1'b1;
else T_Res = 1'b0;
if (XY_State != 2'b00 && XY_Ind == 1'b0 &&
((Set_Addr_To == aXY) ||
(mcycle[0] && IR == 8'b11001011) ||
(mcycle[0] && IR == 8'b00110110)))
NextIs_XY_Fetch = 1'b1;
else
NextIs_XY_Fetch = 1'b0;
 
if (ExchangeRp)
Save_Mux = BusB;
else if (!Save_ALU_r)
Save_Mux = DI_Reg;
else
Save_Mux = ALU_Q;
end // always @ *
always @ (posedge clk or negedge reset_n)
begin
if (reset_n == 1'b0 )
begin
PC <= #1 0; // Program Counter
A <= #1 0;
TmpAddr <= #1 0;
IR <= #1 8'b00000000;
ISet <= #1 2'b00;
XY_State <= #1 2'b00;
IStatus <= #1 2'b00;
mcycles <= #1 3'b000;
dout <= #1 8'b00000000;
 
ACC <= #1 8'hFF;
F <= #1 8'hFF;
Ap <= #1 8'hFF;
Fp <= #1 8'hFF;
I <= #1 0;
`ifdef TV80_REFRESH
R <= #1 0;
`endif
SP <= #1 16'hFFFF;
Alternate <= #1 1'b0;
 
Read_To_Reg_r <= #1 5'b00000;
Arith16_r <= #1 1'b0;
BTR_r <= #1 1'b0;
Z16_r <= #1 1'b0;
ALU_Op_r <= #1 4'b0000;
Save_ALU_r <= #1 1'b0;
PreserveC_r <= #1 1'b0;
XY_Ind <= #1 1'b0;
end
else
begin
 
if (ClkEn == 1'b1 )
begin
 
ALU_Op_r <= #1 4'b0000;
Save_ALU_r <= #1 1'b0;
Read_To_Reg_r <= #1 5'b00000;
 
mcycles <= #1 mcycles_d;
 
if (IMode != 2'b11 )
begin
IStatus <= #1 IMode;
end
 
Arith16_r <= #1 Arith16;
PreserveC_r <= #1 PreserveC;
if (ISet == 2'b10 && ALU_Op[2] == 1'b0 && ALU_Op[0] == 1'b1 && mcycle[2] )
begin
Z16_r <= #1 1'b1;
end
else
begin
Z16_r <= #1 1'b0;
end
 
if (mcycle[0] && (tstate[1] | tstate[2] | tstate[3] ))
begin
// mcycle == 1 && tstate == 1, 2, || 3
if (tstate[2] && wait_n == 1'b1 )
begin
`ifdef TV80_REFRESH
if (Mode < 2 )
begin
A[7:0] <= #1 R;
A[15:8] <= #1 I;
R[6:0] <= #1 R[6:0] + 1;
end
`endif
if (Jump == 1'b0 && Call == 1'b0 && NMICycle == 1'b0 && IntCycle == 1'b0 && ~ (Halt_FF == 1'b1 || Halt == 1'b1) )
begin
PC <= #1 PC16;
end
 
if (IntCycle == 1'b1 && IStatus == 2'b01 )
begin
IR <= #1 8'b11111111;
end
else if (Halt_FF == 1'b1 || (IntCycle == 1'b1 && IStatus == 2'b10) || NMICycle == 1'b1 )
begin
IR <= #1 8'b00000000;
TmpAddr[7:0] <= #1 dinst; // Special M1 vector fetch
end
else
begin
IR <= #1 dinst;
end
 
ISet <= #1 2'b00;
if (Prefix != 2'b00 )
begin
if (Prefix == 2'b11 )
begin
if (IR[5] == 1'b1 )
begin
XY_State <= #1 2'b10;
end
else
begin
XY_State <= #1 2'b01;
end
end
else
begin
if (Prefix == 2'b10 )
begin
XY_State <= #1 2'b00;
XY_Ind <= #1 1'b0;
end
ISet <= #1 Prefix;
end
end
else
begin
XY_State <= #1 2'b00;
XY_Ind <= #1 1'b0;
end
end // if (tstate == 2 && wait_n == 1'b1 )
 
end
else
begin
// either (mcycle > 1) OR (mcycle == 1 AND tstate > 3)
 
if (mcycle[5] )
begin
XY_Ind <= #1 1'b1;
if (Prefix == 2'b01 )
begin
ISet <= #1 2'b01;
end
end
if (T_Res == 1'b1 )
begin
BTR_r <= #1 (I_BT || I_BC || I_BTR) && ~ No_BTR;
if (Jump == 1'b1 )
begin
A[15:8] <= #1 DI_Reg;
A[7:0] <= #1 TmpAddr[7:0];
PC[15:8] <= #1 DI_Reg;
PC[7:0] <= #1 TmpAddr[7:0];
end
else if (JumpXY == 1'b1 )
begin
A <= #1 RegBusC;
PC <= #1 RegBusC;
end else if (Call == 1'b1 || RstP == 1'b1 )
begin
A <= #1 TmpAddr;
PC <= #1 TmpAddr;
end
else if (last_mcycle && NMICycle == 1'b1 )
begin
A <= #1 16'b0000000001100110;
PC <= #1 16'b0000000001100110;
end
else if (mcycle[2] && IntCycle == 1'b1 && IStatus == 2'b10 )
begin
A[15:8] <= #1 I;
A[7:0] <= #1 TmpAddr[7:0];
PC[15:8] <= #1 I;
PC[7:0] <= #1 TmpAddr[7:0];
end
else
begin
case (Set_Addr_To)
aXY :
begin
if (XY_State == 2'b00 )
begin
A <= #1 RegBusC;
end
else
begin
if (NextIs_XY_Fetch == 1'b1 )
begin
A <= #1 PC;
end
else
begin
A <= #1 TmpAddr;
end
end // else: !if(XY_State == 2'b00 )
end // case: aXY
aIOA :
begin
if (Mode == 3 )
begin
// Memory map I/O on GBZ80
A[15:8] <= #1 8'hFF;
end
else if (Mode == 2 )
begin
// Duplicate I/O address on 8080
A[15:8] <= #1 DI_Reg;
end
else
begin
A[15:8] <= #1 ACC;
end
A[7:0] <= #1 DI_Reg;
end // case: aIOA
 
aSP :
begin
A <= #1 SP;
end
aBC :
begin
if (Mode == 3 && iorq_i == 1'b1 )
begin
// Memory map I/O on GBZ80
A[15:8] <= #1 8'hFF;
A[7:0] <= #1 RegBusC[7:0];
end
else
begin
A <= #1 RegBusC;
end
end // case: aBC
aDE :
begin
A <= #1 RegBusC;
end
aZI :
begin
if (Inc_WZ == 1'b1 )
begin
A <= #1 TmpAddr + 1;
end
else
begin
A[15:8] <= #1 DI_Reg;
A[7:0] <= #1 TmpAddr[7:0];
end
end // case: aZI
default :
begin
A <= #1 PC;
end
endcase // case(Set_Addr_To)
end // else: !if(mcycle[2] && IntCycle == 1'b1 && IStatus == 2'b10 )
 
Save_ALU_r <= #1 Save_ALU;
ALU_Op_r <= #1 ALU_Op;
if (I_CPL == 1'b1 )
begin
// CPL
ACC <= #1 ~ ACC;
F[Flag_Y] <= #1 ~ ACC[5];
F[Flag_H] <= #1 1'b1;
F[Flag_X] <= #1 ~ ACC[3];
F[Flag_N] <= #1 1'b1;
end
if (I_CCF == 1'b1 )
begin
// CCF
F[Flag_C] <= #1 ~ F[Flag_C];
F[Flag_Y] <= #1 ACC[5];
F[Flag_H] <= #1 F[Flag_C];
F[Flag_X] <= #1 ACC[3];
F[Flag_N] <= #1 1'b0;
end
if (I_SCF == 1'b1 )
begin
// SCF
F[Flag_C] <= #1 1'b1;
F[Flag_Y] <= #1 ACC[5];
F[Flag_H] <= #1 1'b0;
F[Flag_X] <= #1 ACC[3];
F[Flag_N] <= #1 1'b0;
end
end // if (T_Res == 1'b1 )
 
if (tstate[2] && wait_n == 1'b1 )
begin
if (ISet == 2'b01 && mcycle[6] )
begin
IR <= #1 dinst;
end
if (JumpE == 1'b1 )
begin
PC <= #1 PC16;
end
else if (Inc_PC == 1'b1 )
begin
//PC <= #1 PC + 1;
PC <= #1 PC16;
end
if (BTR_r == 1'b1 )
begin
//PC <= #1 PC - 2;
PC <= #1 PC16;
end
if (RstP == 1'b1 )
begin
TmpAddr <= #1 { 10'h0, IR[5:3], 3'h0 };
//TmpAddr <= #1 (others =>1'b0);
//TmpAddr[5:3] <= #1 IR[5:3];
end
end
if (tstate[3] && mcycle[5] )
begin
TmpAddr <= #1 SP16;
end
 
if ((tstate[2] && wait_n == 1'b1) || (tstate[4] && mcycle[0]) )
begin
if (IncDec_16[2:0] == 3'b111 )
begin
SP <= #1 SP16;
end
end
 
if (LDSPHL == 1'b1 )
begin
SP <= #1 RegBusC;
end
if (ExchangeAF == 1'b1 )
begin
Ap <= #1 ACC;
ACC <= #1 Ap;
Fp <= #1 F;
F <= #1 Fp;
end
if (ExchangeRS == 1'b1 )
begin
Alternate <= #1 ~ Alternate;
end
end // else: !if(mcycle == 3'b001 && tstate(2) == 1'b0 )
 
if (tstate[3] )
begin
if (LDZ == 1'b1 )
begin
TmpAddr[7:0] <= #1 DI_Reg;
end
if (LDW == 1'b1 )
begin
TmpAddr[15:8] <= #1 DI_Reg;
end
 
if (Special_LD[2] == 1'b1 )
begin
case (Special_LD[1:0])
2'b00 :
begin
ACC <= #1 I;
F[Flag_P] <= #1 IntE_FF2;
F[Flag_Z] <= (I == 0);
F[Flag_S] <= I[7];
F[Flag_H] <= 0;
F[Flag_N] <= 0;
end
2'b01 :
begin
`ifdef TV80_REFRESH
ACC <= #1 R;
`else
ACC <= #1 0;
`endif
F[Flag_P] <= #1 IntE_FF2;
F[Flag_Z] <= (I == 0);
F[Flag_S] <= I[7];
F[Flag_H] <= 0;
F[Flag_N] <= 0;
end
2'b10 :
I <= #1 ACC;
 
`ifdef TV80_REFRESH
default :
R <= #1 ACC;
`else
default : ;
`endif
endcase
end
end // if (tstate == 3 )
 
if ((I_DJNZ == 1'b0 && Save_ALU_r == 1'b1) || ALU_Op_r == 4'b1001 )
begin
if (Mode == 3 )
begin
F[6] <= #1 F_Out[6];
F[5] <= #1 F_Out[5];
F[7] <= #1 F_Out[7];
if (PreserveC_r == 1'b0 )
begin
F[4] <= #1 F_Out[4];
end
end
else
begin
F[7:1] <= #1 F_Out[7:1];
if (PreserveC_r == 1'b0 )
begin
F[Flag_C] <= #1 F_Out[0];
end
end
end // if ((I_DJNZ == 1'b0 && Save_ALU_r == 1'b1) || ALU_Op_r == 4'b1001 )
if (T_Res == 1'b1 && I_INRC == 1'b1 )
begin
F[Flag_H] <= #1 1'b0;
F[Flag_N] <= #1 1'b0;
if (DI_Reg[7:0] == 8'b00000000 )
begin
F[Flag_Z] <= #1 1'b1;
end
else
begin
F[Flag_Z] <= #1 1'b0;
end
F[Flag_S] <= #1 DI_Reg[7];
F[Flag_P] <= #1 ~ (^DI_Reg[7:0]);
end // if (T_Res == 1'b1 && I_INRC == 1'b1 )
 
if (tstate[1] && Auto_Wait_t1 == 1'b0 )
begin
dout <= #1 BusB;
if (I_RLD == 1'b1 )
begin
dout[3:0] <= #1 BusA[3:0];
dout[7:4] <= #1 BusB[3:0];
end
if (I_RRD == 1'b1 )
begin
dout[3:0] <= #1 BusB[7:4];
dout[7:4] <= #1 BusA[3:0];
end
end
 
if (T_Res == 1'b1 )
begin
Read_To_Reg_r[3:0] <= #1 Set_BusA_To;
Read_To_Reg_r[4] <= #1 Read_To_Reg;
if (Read_To_Acc == 1'b1 )
begin
Read_To_Reg_r[3:0] <= #1 4'b0111;
Read_To_Reg_r[4] <= #1 1'b1;
end
end
 
if (tstate[1] && I_BT == 1'b1 )
begin
F[Flag_X] <= #1 ALU_Q[3];
F[Flag_Y] <= #1 ALU_Q[1];
F[Flag_H] <= #1 1'b0;
F[Flag_N] <= #1 1'b0;
end
if (I_BC == 1'b1 || I_BT == 1'b1 )
begin
F[Flag_P] <= #1 IncDecZ;
end
 
if ((tstate[1] && Save_ALU_r == 1'b0 && Auto_Wait_t1 == 1'b0) ||
(Save_ALU_r == 1'b1 && ALU_Op_r != 4'b0111) )
begin
case (Read_To_Reg_r)
5'b10111 :
ACC <= #1 Save_Mux;
5'b10110 :
dout <= #1 Save_Mux;
5'b11000 :
SP[7:0] <= #1 Save_Mux;
5'b11001 :
SP[15:8] <= #1 Save_Mux;
5'b11011 :
F <= #1 Save_Mux;
default : ;
endcase
end // if ((tstate == 1 && Save_ALU_r == 1'b0 && Auto_Wait_t1 == 1'b0) ||...
end // if (ClkEn == 1'b1 )
end // else: !if(reset_n == 1'b0 )
end
 
//-------------------------------------------------------------------------
//
// BC('), DE('), HL('), IX && IY
//
//-------------------------------------------------------------------------
always @ (posedge clk)
begin
if (ClkEn == 1'b1 )
begin
// Bus A / Write
RegAddrA_r <= #1 { Alternate, Set_BusA_To[2:1] };
if (XY_Ind == 1'b0 && XY_State != 2'b00 && Set_BusA_To[2:1] == 2'b10 )
begin
RegAddrA_r <= #1 { XY_State[1], 2'b11 };
end
 
// Bus B
RegAddrB_r <= #1 { Alternate, Set_BusB_To[2:1] };
if (XY_Ind == 1'b0 && XY_State != 2'b00 && Set_BusB_To[2:1] == 2'b10 )
begin
RegAddrB_r <= #1 { XY_State[1], 2'b11 };
end
 
// Address from register
RegAddrC <= #1 { Alternate, Set_Addr_To[1:0] };
// Jump (HL), LD SP,HL
if ((JumpXY == 1'b1 || LDSPHL == 1'b1) )
begin
RegAddrC <= #1 { Alternate, 2'b10 };
end
if (((JumpXY == 1'b1 || LDSPHL == 1'b1) && XY_State != 2'b00) || (mcycle[5]) )
begin
RegAddrC <= #1 { XY_State[1], 2'b11 };
end
 
if (I_DJNZ == 1'b1 && Save_ALU_r == 1'b1 && Mode < 2 )
begin
IncDecZ <= #1 F_Out[Flag_Z];
end
if ((tstate[2] || (tstate[3] && mcycle[0])) && IncDec_16[2:0] == 3'b100 )
begin
if (ID16 == 0 )
begin
IncDecZ <= #1 1'b0;
end
else
begin
IncDecZ <= #1 1'b1;
end
end
RegBusA_r <= #1 RegBusA;
end
end // always @ (posedge clk)
 
always @(/*AUTOSENSE*/Alternate or ExchangeDH or IncDec_16
or RegAddrA_r or RegAddrB_r or XY_State or mcycle or tstate)
begin
if ((tstate[2] || (tstate[3] && mcycle[0] && IncDec_16[2] == 1'b1)) && XY_State == 2'b00)
RegAddrA = { Alternate, IncDec_16[1:0] };
else if ((tstate[2] || (tstate[3] && mcycle[0] && IncDec_16[2] == 1'b1)) && IncDec_16[1:0] == 2'b10)
RegAddrA = { XY_State[1], 2'b11 };
else if (ExchangeDH == 1'b1 && tstate[3])
RegAddrA = { Alternate, 2'b10 };
else if (ExchangeDH == 1'b1 && tstate[4])
RegAddrA = { Alternate, 2'b01 };
else
RegAddrA = RegAddrA_r;
if (ExchangeDH == 1'b1 && tstate[3])
RegAddrB = { Alternate, 2'b01 };
else
RegAddrB = RegAddrB_r;
end // always @ *
 
always @(/*AUTOSENSE*/ALU_Op_r or Auto_Wait_t1 or ExchangeDH
or IncDec_16 or Read_To_Reg_r or Save_ALU_r or mcycle
or tstate or wait_n)
begin
RegWEH = 1'b0;
RegWEL = 1'b0;
if ((tstate[1] && ~Save_ALU_r && ~Auto_Wait_t1) ||
(Save_ALU_r && (ALU_Op_r != 4'b0111)) )
begin
case (Read_To_Reg_r)
5'b10000 , 5'b10001 , 5'b10010 , 5'b10011 , 5'b10100 , 5'b10101 :
begin
RegWEH = ~ Read_To_Reg_r[0];
RegWEL = Read_To_Reg_r[0];
end // UNMATCHED !!
default : ;
endcase // case(Read_To_Reg_r)
end // if ((tstate == 1 && Save_ALU_r == 1'b0 && Auto_Wait_t1 == 1'b0) ||...
 
if (ExchangeDH && (tstate[3] || tstate[4]) )
begin
RegWEH = 1'b1;
RegWEL = 1'b1;
end
 
if (IncDec_16[2] && ((tstate[2] && wait_n && ~mcycle[0]) || (tstate[3] && mcycle[0])) )
begin
case (IncDec_16[1:0])
2'b00 , 2'b01 , 2'b10 :
begin
RegWEH = 1'b1;
RegWEL = 1'b1;
end // UNMATCHED !!
default : ;
endcase
end
end // always @ *
 
always @(/*AUTOSENSE*/ExchangeDH or ID16 or IncDec_16 or RegBusA_r
or RegBusB or Save_Mux or mcycle or tstate)
begin
RegDIH = Save_Mux;
RegDIL = Save_Mux;
 
if (ExchangeDH == 1'b1 && tstate[3] )
begin
RegDIH = RegBusB[15:8];
RegDIL = RegBusB[7:0];
end
else if (ExchangeDH == 1'b1 && tstate[4] )
begin
RegDIH = RegBusA_r[15:8];
RegDIL = RegBusA_r[7:0];
end
else if (IncDec_16[2] == 1'b1 && ((tstate[2] && ~mcycle[0]) || (tstate[3] && mcycle[0])) )
begin
RegDIH = ID16[15:8];
RegDIL = ID16[7:0];
end
end
 
tv80_reg i_reg
(
.clk (clk),
.CEN (ClkEn),
.WEH (RegWEH),
.WEL (RegWEL),
.AddrA (RegAddrA),
.AddrB (RegAddrB),
.AddrC (RegAddrC),
.DIH (RegDIH),
.DIL (RegDIL),
.DOAH (RegBusA[15:8]),
.DOAL (RegBusA[7:0]),
.DOBH (RegBusB[15:8]),
.DOBL (RegBusB[7:0]),
.DOCH (RegBusC[15:8]),
.DOCL (RegBusC[7:0])
);
 
//-------------------------------------------------------------------------
//
// Buses
//
//-------------------------------------------------------------------------
 
always @ (posedge clk)
begin
if (ClkEn == 1'b1 )
begin
case (Set_BusB_To)
4'b0111 :
BusB <= #1 ACC;
4'b0000 , 4'b0001 , 4'b0010 , 4'b0011 , 4'b0100 , 4'b0101 :
begin
if (Set_BusB_To[0] == 1'b1 )
begin
BusB <= #1 RegBusB[7:0];
end
else
begin
BusB <= #1 RegBusB[15:8];
end
end
4'b0110 :
BusB <= #1 DI_Reg;
4'b1000 :
BusB <= #1 SP[7:0];
4'b1001 :
BusB <= #1 SP[15:8];
4'b1010 :
BusB <= #1 8'b00000001;
4'b1011 :
BusB <= #1 F;
4'b1100 :
BusB <= #1 PC[7:0];
4'b1101 :
BusB <= #1 PC[15:8];
4'b1110 :
BusB <= #1 8'b00000000;
default :
BusB <= #1 8'h0;
endcase
 
case (Set_BusA_To)
4'b0111 :
BusA <= #1 ACC;
4'b0000 , 4'b0001 , 4'b0010 , 4'b0011 , 4'b0100 , 4'b0101 :
begin
if (Set_BusA_To[0] == 1'b1 )
begin
BusA <= #1 RegBusA[7:0];
end
else
begin
BusA <= #1 RegBusA[15:8];
end
end
4'b0110 :
BusA <= #1 DI_Reg;
4'b1000 :
BusA <= #1 SP[7:0];
4'b1001 :
BusA <= #1 SP[15:8];
4'b1010 :
BusA <= #1 8'b00000000;
default :
BusA <= #1 8'h0;
endcase
end
end
 
//-------------------------------------------------------------------------
//
// Generate external control signals
//
//-------------------------------------------------------------------------
`ifdef TV80_REFRESH
always @ (posedge clk or negedge reset_n)
begin
if (reset_n == 1'b0 )
begin
rfsh_n <= #1 1'b1;
end
else
begin
if (cen == 1'b1 )
begin
if (mcycle[0] && ((tstate[2] && wait_n == 1'b1) || tstate[3]) )
begin
rfsh_n <= #1 1'b0;
end
else
begin
rfsh_n <= #1 1'b1;
end
end
end
end // always @ (posedge clk or negedge reset_n)
`else // !`ifdef TV80_REFRESH
assign rfsh_n = 1'b1;
`endif
 
always @(/*AUTOSENSE*/BusAck or Halt_FF or I_DJNZ or IntCycle
or IntE_FF1 or di or iorq_i or mcycle or tstate)
begin
mc = mcycle;
ts = tstate;
DI_Reg = di;
halt_n = ~ Halt_FF;
busak_n = ~ BusAck;
intcycle_n = ~ IntCycle;
IntE = IntE_FF1;
iorq = iorq_i;
stop = I_DJNZ;
end
 
//-----------------------------------------------------------------------
//
// Syncronise inputs
//
//-----------------------------------------------------------------------
 
always @ (posedge clk or negedge reset_n)
begin : sync_inputs
if (~reset_n)
begin
BusReq_s <= #1 1'b0;
INT_s <= #1 1'b0;
NMI_s <= #1 1'b0;
Oldnmi_n <= #1 1'b0;
end
else
begin
if (cen == 1'b1 )
begin
BusReq_s <= #1 ~ busrq_n;
INT_s <= #1 ~ int_n;
if (NMICycle == 1'b1 )
begin
NMI_s <= #1 1'b0;
end
else if (nmi_n == 1'b0 && Oldnmi_n == 1'b1 )
begin
NMI_s <= #1 1'b1;
end
Oldnmi_n <= #1 nmi_n;
end
end
end
 
//-----------------------------------------------------------------------
//
// Main state machine
//
//-----------------------------------------------------------------------
 
always @ (posedge clk or negedge reset_n)
begin
if (reset_n == 1'b0 )
begin
mcycle <= #1 7'b0000001;
tstate <= #1 7'b0000001;
Pre_XY_F_M <= #1 3'b000;
Halt_FF <= #1 1'b0;
BusAck <= #1 1'b0;
NMICycle <= #1 1'b0;
IntCycle <= #1 1'b0;
IntE_FF1 <= #1 1'b0;
IntE_FF2 <= #1 1'b0;
No_BTR <= #1 1'b0;
Auto_Wait_t1 <= #1 1'b0;
Auto_Wait_t2 <= #1 1'b0;
m1_n <= #1 1'b1;
end
else
begin
if (cen == 1'b1 )
begin
if (T_Res == 1'b1 )
begin
Auto_Wait_t1 <= #1 1'b0;
end
else
begin
Auto_Wait_t1 <= #1 Auto_Wait || (iorq_i & ~Auto_Wait_t2);
end
Auto_Wait_t2 <= #1 Auto_Wait_t1 & !T_Res;
No_BTR <= #1 (I_BT && (~ IR[4] || ~ F[Flag_P])) ||
(I_BC && (~ IR[4] || F[Flag_Z] || ~ F[Flag_P])) ||
(I_BTR && (~ IR[4] || F[Flag_Z]));
if (tstate[2] )
begin
if (SetEI == 1'b1 )
begin
if (!NMICycle)
IntE_FF1 <= #1 1'b1;
IntE_FF2 <= #1 1'b1;
end
if (I_RETN == 1'b1 )
begin
IntE_FF1 <= #1 IntE_FF2;
end
end
if (tstate[3] )
begin
if (SetDI == 1'b1 )
begin
IntE_FF1 <= #1 1'b0;
IntE_FF2 <= #1 1'b0;
end
end
if (IntCycle == 1'b1 || NMICycle == 1'b1 )
begin
Halt_FF <= #1 1'b0;
end
if (mcycle[0] && tstate[2] && wait_n == 1'b1 )
begin
m1_n <= #1 1'b1;
end
if (BusReq_s == 1'b1 && BusAck == 1'b1 )
begin
end
else
begin
BusAck <= #1 1'b0;
if (tstate[2] && wait_n == 1'b0 )
begin
end
else if (T_Res == 1'b1 )
begin
if (Halt == 1'b1 )
begin
Halt_FF <= #1 1'b1;
end
if (BusReq_s == 1'b1 )
begin
BusAck <= #1 1'b1;
end
else
begin
tstate <= #1 7'b0000010;
if (NextIs_XY_Fetch == 1'b1 )
begin
mcycle <= #1 7'b0100000;
Pre_XY_F_M <= #1 mcyc_to_number(mcycle);
if (IR == 8'b00110110 && Mode == 0 )
begin
Pre_XY_F_M <= #1 3'b010;
end
end
else if ((mcycle[6]) || (mcycle[5] && Mode == 1 && ISet != 2'b01) )
begin
mcycle <= #1 number_to_bitvec(Pre_XY_F_M + 1);
end
else if ((last_mcycle) ||
No_BTR == 1'b1 ||
(mcycle[1] && I_DJNZ == 1'b1 && IncDecZ == 1'b1) )
begin
m1_n <= #1 1'b0;
mcycle <= #1 7'b0000001;
IntCycle <= #1 1'b0;
NMICycle <= #1 1'b0;
if (NMI_s == 1'b1 && Prefix == 2'b00 )
begin
NMICycle <= #1 1'b1;
IntE_FF1 <= #1 1'b0;
end
else if ((IntE_FF1 == 1'b1 && INT_s == 1'b1) && Prefix == 2'b00 && SetEI == 1'b0 )
begin
IntCycle <= #1 1'b1;
IntE_FF1 <= #1 1'b0;
IntE_FF2 <= #1 1'b0;
end
end
else
begin
mcycle <= #1 { mcycle[5:0], mcycle[6] };
end
end
end
else
begin // verilog has no "nor" operator
if ( ~(Auto_Wait == 1'b1 && Auto_Wait_t2 == 1'b0) &&
~(IOWait == 1 && iorq_i == 1'b1 && Auto_Wait_t1 == 1'b0) )
begin
tstate <= #1 { tstate[5:0], tstate[6] };
end
end
end
if (tstate[0])
begin
m1_n <= #1 1'b0;
end
end
end
end
 
always @(/*AUTOSENSE*/BTR_r or DI_Reg or IncDec_16 or JumpE or PC
or RegBusA or RegBusC or SP or tstate)
begin
if (JumpE == 1'b1 )
begin
PC16_B = { {8{DI_Reg[7]}}, DI_Reg };
end
else if (BTR_r == 1'b1 )
begin
PC16_B = -2;
end
else
begin
PC16_B = 1;
end
 
if (tstate[3])
begin
SP16_A = RegBusC;
SP16_B = { {8{DI_Reg[7]}}, DI_Reg };
end
else
begin
// suspect that ID16 and SP16 could be shared
SP16_A = SP;
if (IncDec_16[3] == 1'b1)
SP16_B = -1;
else
SP16_B = 1;
end
 
if (IncDec_16[3])
ID16_B = -1;
else
ID16_B = 1;
 
ID16 = RegBusA + ID16_B;
PC16 = PC + PC16_B;
SP16 = SP16_A + SP16_B;
end // always @ *
 
always @(/*AUTOSENSE*/IntCycle or NMICycle or mcycle)
begin
Auto_Wait = 1'b0;
if (IntCycle == 1'b1 || NMICycle == 1'b1 )
begin
if (mcycle[0] )
begin
Auto_Wait = 1'b1;
end
end
end // always @ *
endmodule // T80
 
/zx_ula/branches/xilinx/spectrum_48k_for_digilent_spartan3_starter_kit_with_ps2_keyboard/bitstreams/spartan3-1000_sp48k.bit Cannot display: file marked as a binary type. svn:mime-type = application/octet-stream
zx_ula/branches/xilinx/spectrum_48k_for_digilent_spartan3_starter_kit_with_ps2_keyboard/bitstreams/spartan3-1000_sp48k.bit Property changes : Added: svn:mime-type ## -0,0 +1 ## +application/octet-stream \ No newline at end of property Index: zx_ula/branches/xilinx/spectrum_48k_for_digilent_spartan3_starter_kit_with_ps2_keyboard/bitstreams/spartan3-200_sp48k.bit =================================================================== Cannot display: file marked as a binary type. svn:mime-type = application/octet-stream Index: zx_ula/branches/xilinx/spectrum_48k_for_digilent_spartan3_starter_kit_with_ps2_keyboard/bitstreams/spartan3-200_sp48k.bit =================================================================== --- zx_ula/branches/xilinx/spectrum_48k_for_digilent_spartan3_starter_kit_with_ps2_keyboard/bitstreams/spartan3-200_sp48k.bit (nonexistent) +++ zx_ula/branches/xilinx/spectrum_48k_for_digilent_spartan3_starter_kit_with_ps2_keyboard/bitstreams/spartan3-200_sp48k.bit (revision 10)
zx_ula/branches/xilinx/spectrum_48k_for_digilent_spartan3_starter_kit_with_ps2_keyboard/bitstreams/spartan3-200_sp48k.bit Property changes : Added: svn:mime-type ## -0,0 +1 ## +application/octet-stream \ No newline at end of property

powered by: WebSVN 2.1.0

© copyright 1999-2024 OpenCores.org, equivalent to Oliscience, all rights reserved. OpenCores®, registered trademark.