I did an electronic dice game ( 3 die ) program in VHDL. Basically , the program has 216 different dice values combinations which was simply assigned by me. The dice has 3 segment displays . I defined the
3 displays as output " seg " . However , I can't figured out any idea to write this electronic dice ( 3 die )program using the function " Random Number Generator " where the dice can get random combinations randomly which means I don't have to assign the 216 dice combintions . Anyone have any idea how to write the program ? Perhaps write the beginning part of the program so that I could roughly have an idea to continue from there. I appreciate your help.Thanks a lot .
Below is my program:
--------------------------------------------------------------------------------
library ieee; use ieee.std_logic_1164.all; use ieee.std_logic_unsigned.all;
entity dice is port( reset,clk : in std_logic; seg: out std_logic_vector (20 downto 0)); end dice;
architecture archdice of dice is type dice_states is (s1,s2,s3,s4,s5,s6,s7,s8,s9,s10,s11,s12,s13,s14,s15,s16,s17, s18,s19,s20,s21,s22,s23,s24,s25,s26,s27,s28,s29,s30,s31,s32, s33,s34,s35,s36,s37,s38,s39,s40,s41,s42,s43,s44,s45,s46,s47, s48,s49,s50,s51,s52,s53,s54,s55,s56,s57,s58,s59,s60,s61,s62, s63,s64,s65,s66,s67,s68,s69,s70,s71,s72,s73,s74,s75,s76,s77, s78,s79,s80,s81,s82,s83,s84,s85,s86,s87,s88,s89,s90,s91,s92, s93,s94,s95,s96,s97,s98,s99,s100,s101,s102,s103,s104,s105, s106,s107,s108,s109,s110,s111,s112,s113,s114,s115,s116,s117, s118,s119,s120,s121,s122,s123,s124,s125,s126,s127,s128,s129, s130,s131,s132,s133,s134,s135,s136,s137,s138,s139,s140,s141, s142,s143,s144,s145,s146,s147,s148,s149,s150,s151,s152,s153, s154,s155,s156,s157,s158,s159,s160,s161,s162,s163,s164,s165, s166,s167,s168,s169,s170,s171,s172,s173,s174,s175,s176,s177, s178,s179,s180,s181,s182,s183,s184,s185,s186,s187,s188,s189, s190,s191,s192,s193,s194,s195,s196,s197,s198,s199,s200,s201, s202,s203,s204,s205,s206,s207,s208,s209,s210,s211,s212,s213, s214,s215,s216); signal sm: dice_states; begin
process (sm,clk) begin if reset = '1' then sm