Continue to Site

Welcome to EDAboard.com

Welcome to our site! EDAboard.com is an international Electronics Discussion Forum focused on EDA software, circuits, schematics, books, theory, papers, asic, pld, 8051, DSP, Network, RF, Analog Design, PCB, Service Manuals... and a whole lot more! To participate you need to register. Registration is free. Click here to register now.

[SOLVED] Help me with code for serial in parallel out (Xilins Spartan 3E chipset)

Status
Not open for further replies.

dimitarlazarevski

Newbie level 2
Joined
May 18, 2008
Messages
2
Helped
0
Reputation
0
Reaction score
0
Trophy points
1,281
Activity points
1,307
Could any one provide me the code for serial in parallel out. It has to have 6 bit out data. The serial in data i have to put it by my hand in binary code. The board is Xilinx Spartan 3E; chipset? XC3S100E; TQ144

BASYS (Basic System Board) Digilent
Thank u

library IEEE;
use IEEE.STD_LOGIC_1164.ALL;
use IEEE.STD_LOGIC_ARITH.ALL;
use IEEE.STD_LOGIC_UNSIGNED.ALL;

entity jc_top is
Port ( DIN : in STD_LOGIC;
START : in STD_LOGIC;
RST : in STD_LOGIC;
CLK_MAN : in STD_LOGIC;
DOUT : out STD_LOGIC_VECTOR (5 downto 0):="ZZZZZZ");
end jc_top;

architecture Behavioral of jc_top is
signal Buff: std_logic_vector (5 downto 0);
signal tmp: std_logic_vector (5 downto 0);
begin

process(CLK_MAN, RST, START)
variable CNT: integer :=0;
begin
if (RST = '1') then
if(START = '0') then
CNT:=0;
-- DOUT(5 downto 0)<="ZZZZZZ";
tmp(5 downto 0)<="ZZZZZZ";
BUFF(5 downto 0)<="000000";
elsif(CLK_MAN'event and CLK_MAN = '1') then
CNT:=CNT+1;
BUFF <= BUFF (4 downto 0) & DIN;

-- if CNT=5 then tmp(5 downto 0)<="ZZZZZZ"; end if;
if CNT=6 then
tmp(5 downto 0)<= BUFF(5 downto 0);
--DOUT(5 downto 0)<= BUFF(5 downto 0);
CNT:=0;
end if;
end if;
elseif(RST = '0') then
CNT:=0;
-- DOUT(5 downto 0)<="ZZZZZZ";
tmp(5 downto 0)<="ZZZZZZ";
BUFF(5 downto 0)<="000000";
end if;
end process;
DOUT(5 downto 0)<=Tmp(5 downto 0);
end Behavioral;


For example: I have to put one slide switch for START, one button for CLK, one slide switch for data in ("0" or "1") and one button for Reset (RST). And I put the slide switch Start in position 1 (Up), and I start to press the CLK button 6 times. And I put the data in (if the slide switch for data is down -> "0", if it's up -> "1"). When I press the CLK 6 times the leds indicate data out. Then I should press Reset button and I want to be reseted. Is this code correct?
Best regards.
 

Status
Not open for further replies.

Part and Inventory Search

Welcome to EDABoard.com

Sponsor

Back
Top