| Blake's profileBlake的共享空间PhotosBlogLists | Help |
|
Blake的共享空间Love is not love... November 08 VHDL code for lab4library ieee;
use ieee.std_logic_1164.all; use ieee.std_logic_unsigned.all; entity lab4 is
port(reset: in std_logic; -- control_signals_out: out std_logic_vector (21 downto 0); clk : in std_logic; instruction_in: in std_logic_vector(15 downto 0); -- instruction_out: out std_logic_vector(15 downto 0); get_next_instruction: out std_logic; datapath_out : out std_logic_vector(7 downto 0)); -- state_registerfile_out: out std_logic_vector (7 downto 0)); end lab4 ; architecture behavioural of lab4 is
type REGARRAY is array (7 downto 0) of std_logic_vector(7 downto 0); signal reg: REGARRAY; signal registerx,registery,registerz:std_logic_vector(7 downto 0); signal muxA_out,muxB_out,ALU_OUT:std_logic_vector(7 downto 0); signal registerfile_out:std_logic_vector (7 downto 0); type state_types is (Read1,Read2,S1,S2,S3,S4); signal present_state: state_types := Read1; signal instr_register_out: std_logic_vector(15 downto 0); signal load_ir : std_logic; signal datapath_in : std_logic_vector(7 downto 0); signal state_machine_out: std_logic_vector (2 downto 0); signal muxasel : std_logic;
signal write : std_logic; signal writenum : std_logic_vector(2 downto 0); signal readnum : std_logic_vector(2 downto 0); signal loadx : std_logic; signal loady : std_logic; signal muxbsel : std_logic; signal funct : std_logic_vector(1 downto 0); signal loadz : std_logic; signal control_signals: std_logic_vector (21 downto 0); begin
process(clk, load_ir) -------Instruction_register begin if(load_ir='1') then if(clk='1' and clk'event) then instr_register_out<=instruction_in; end if; end if; end process; process(clk,reset)-----state machine begin if(reset = '1') then present_state<= Read1; elsif(clk = '1' and clk'event)then case present_state is when Read1 => present_state<= Read2; when Read2 => present_state<= S1; when S1 => if (instr_register_out(15 downto 14)= "10" or instr_register_out(15 downto 14) ="11")then present_state<= S2; elsif (instr_register_out(15 downto 14) = "01")then present_state<= Read1; end if; when S2 => present_state<= S3; when S3 => if (instr_register_out(15 downto 14)= "10")then present_state<= S4; elsif (instr_register_out(15 downto 14) ="11")then present_state<= Read1; end if; when S4 => present_state<= Read1; end case; end if; end process; process(present_state)
begin case present_state is when Read1 => state_machine_out<= "000"; load_ir <= '0'; get_next_instruction<='1'; when Read2 => state_machine_out<="001"; get_next_instruction<='0'; load_ir <= '1'; when S1 => state_machine_out<= "010"; load_ir <= '0'; get_next_instruction<='0'; when S2 => state_machine_out<= "011"; load_ir <= '0'; get_next_instruction<='0'; when S3 => state_machine_out<= "100"; load_ir <= '0'; get_next_instruction<='0'; when S4 => state_machine_out<= "101"; load_ir <= '0'; get_next_instruction<='0'; end case; end process; --instruction_out<= instr_register_out; process(state_machine_out,instr_register_out,control_signals) begin if (state_machine_out = "010" and instr_register_out (15 downto 11) = "01000")then ---load control_signals<= instr_register_out(7 downto 0)&"01"& instr_register_out(10 downto 8)&"000000000"; elsif (state_machine_out = "010" and instr_register_out (15 downto 11) = "11000")then ----move
control_signals<= "0000000000000"& instr_register_out(4 downto 2)& "010000"; elsif (state_machine_out = "011" and instr_register_out (15 downto 11) = "11000")then control_signals<= "000000000000000000"& "0001"; elsif (state_machine_out = "100" and instr_register_out (15 downto 11) = "11000")then control_signals<= "00000000"&"11"&instr_register_out(10 downto 8)&"000000000"; elsif (state_machine_out = "010" and instr_register_out (15 downto 11) = "11010")then ---neg control_signals<= "0000000000000"& instr_register_out(4 downto 2)& "010000"; elsif (state_machine_out = "011" and instr_register_out (15 downto 11) = "11010")then control_signals<= "000000000000000000"& "0011"; elsif (state_machine_out = "100" and instr_register_out (15 downto 11) = "11010")then control_signals<= "00000000"&"11"&instr_register_out(10 downto 8)&"000000000"; elsif (state_machine_out = "010" and instr_register_out(15 downto 11)="10001")then ---add control_signals<="0000000000000"&instr_register_out(7 downto 5)&"100000"; elsif (state_machine_out = "011" and instr_register_out(15 downto 11)="10001") then ------state S2 control_signals<="0000000000000"&instr_register_out(4 downto 2)&"010000"; elsif (state_machine_out = "100" and instr_register_out(15 downto 11)="10001") then -----state S3 control_signals<="000000000000000000"&"1001"; elsif (state_machine_out = "101" and instr_register_out(15 downto 11)="10001") then ------state S4 control_signals<="00000000"&"11"&instr_register_out(10 downto 8)&"000000000"; elsif (state_machine_out = "010" and instr_register_out(15 downto 11)="10010")then ---sub
control_signals<="0000000000000"&instr_register_out(7 downto 5)&"100000"; elsif (state_machine_out = "011" and instr_register_out(15 downto 11)="10010") then ------state S2 control_signals<="0000000000000"&instr_register_out(4 downto 2)&"010000"; elsif (state_machine_out = "100" and instr_register_out(15 downto 11)="10010") then -----state S3 control_signals<= "000000000000000000"& "0011"; elsif (state_machine_out = "101" and instr_register_out(15 downto 11)="10010") then ------state S4 control_signals<="00000000"&"11"&instr_register_out(10 downto 8)&"000000000"; elsif (state_machine_out = "010" and instr_register_out(15 downto 11)="10101")then ---mul control_signals<="0000000000000"&instr_register_out(7 downto 5)&"100000"; elsif (state_machine_out = "011" and instr_register_out(15 downto 11)="10101") then ------state S2 control_signals<="0000000000000"&instr_register_out(4 downto 2)&"010000"; elsif (state_machine_out = "100" and instr_register_out(15 downto 11)="10101") then -----state S3 control_signals<= "000000000000000000"& "0101"; elsif (state_machine_out = "101" and instr_register_out(15 downto 11)="10101") then ------state S4 control_signals<="00000000"&"11"&instr_register_out(10 downto 8)&"000000000"; elsif (state_machine_out = "010" and instr_register_out(15 downto 11)="10111")then ---and control_signals<="0000000000000"&instr_register_out(7 downto 5)&"100000"; elsif (state_machine_out = "011" and instr_register_out(15 downto 11)="10111") then ------state S2 control_signals<="0000000000000"&instr_register_out(4 downto 2)&"010000"; elsif (state_machine_out = "100" and instr_register_out(15 downto 11)="10111") then -----state S3 control_signals<= "000000000000000000"& "0111"; elsif (state_machine_out = "101" and instr_register_out(15 downto 11)="10111") then ------state S4 control_signals<="00000000"&"11"&instr_register_out(10 downto 8)&"000000000"; else control_signals<="0000000000000000000000"; end if; muxasel<=control_signals(13);
write<=control_signals(12); writenum<=control_signals(11 downto 9); readnum<=control_signals(8 downto 6); loadx<=control_signals(5); loady<=control_signals(4); muxbsel<=control_signals(3); funct<=control_signals(2 downto 1); loadz<=control_signals(0); datapath_in<= control_signals(21 downto 14); end process; process (muxasel,registerz,datapath_in) --Multiplexor A
begin if (muxasel='1') then-- load from data_path_out muxA_out<=registerz; else -- load from data_path_in muxA_out<=datapath_in; end if; end process; process (muxbsel,registerx) --Multiplexor B
begin if (muxbsel='1') then-- load from REGISTERX muxB_out<=registerx; else -- load value "00000000" muxB_out<="00000000"; end if; end process; process (funct,muxB_out,registery) --ALU
variable temp:std_logic_vector(15 downto 0); begin case funct is -- ALU Process when "00"=>ALU_OUT<=muxB_out+registery; when "01"=>ALU_OUT<=muxB_out-registery; when "10"=>temp:=muxB_out*registery; ALU_OUT<=temp(7 downto 0); when "11"=>ALU_OUT<=muxB_out and registery; end case; end process; process(loadx,clk) --register x
begin if(loadx='1') then if(clk='1' and clk'event) then registerx<=registerfile_out; end if; end if; end process; process(loady,clk) --register y
begin if(loady='1') then if(clk='1' and clk'event) then registery<=registerfile_out; end if; end if; end process; process (loadz,clk) --REGISTER Z
begin if (loadz='1') then if (clk='1' and clk'event)then registerz<=ALU_OUT; end if; end if; end process; process(clk)--REGISTER File purely syschronous-write begin if(clk='1' and clk'event) then if(write='1') then reg(conv_integer(writenum))<=muxA_out; end if; end if; end process; process(readnum,reg,registerfile_out)----reigster file purely combinational-read
begin registerfile_out<=reg(conv_integer(readnum)); -- state_registerfile_out<=registerfile_out; end process; datapath_out<=registerz;
--control_signals_out<= control_signals; end behavioural; October 13 散讲1. commerce学生每天花4个小时在学校溜达等下门课,engineering学生每天花4分钟穿梭与课堂之间等下门课。。。。 2.commerce学生每天中午十二点起床上课,engineerng学生每天8点起床上课。。。。 3.commerce学生每晚可以开party到凌晨,engineering学生每晚可以看书到凌晨。。。。 4.commerce学生每天和男/女朋友一起吃饭,engineering学生一边吃饭一边想考试的事情。。 5.commerce学生可以经常相约出游,engineering学生经常相约写作业。。。。 6.commerce学生想着去哪里度过周末,engineering学生想着周末需要复习哪门功课。。。 7.commerce男生每天可以见到很多的美女同学,engineering的男生上课看到个女的还要怀疑她是否真是个女的。。。 8.commerce女生每天可以有很多知己的女性朋友,engineering的女生想见到个女生都难。。。 9.commerce男生每天考虑着要追求哪个女生,engineering的男生天天梦想着要是当初选读commerce就好了。。。 10.commerce女生总会有很多男生追求,engineering的女生即使生活在男生的世界里,也总是被男生忽略。。。。 转载自 孙同学 June 28 初夏刚丛国内回来温哥华。好久好久没有更新我的网站了。
一个星期的风和日丽,让我感受到了温哥华的夏天。好几年了,都没能有机会看她最美丽笑容的刹那。今年,终于如愿以偿了。
她的笑,是那么的甜,是那么的美,是那么的多姿多彩,又是那么的生机黯然。。。。
美丽一直都会给人,每一个人带来好的心情。但我,我好像仍然沉寂在温哥华的冬天中,她的哭声里。
我记得,当我第一次收到UBC那封绿色的录取通知书时,当我第一次走进走如教室时,我知道,我的人生改变了。那时,我又开始有了自信,而且是前所未有的自信。
那时的我,信心千倍,无数对美好人生的设想在我脑中闪现。那时,我总对自己说一句话,只要我想做的事,没有是做不好的,而且没人能比我做的更好。
而现在,
当我面对上个学期的一门不及格给我下个学年造成前所未有的挑战时,
当我面对现在上的所谓的最艰难的APSC201时,
当我面对一个一个泡沫破灭时,
当我面对来自家庭,朋友和同学们的压力时,
当我面对情感时,
。。。。。。
我不知道该如何面对。我尝试过回避,我尝试过喝醉,但要面对的还是要面对。
一个朋友告诉我,何必想那么多呢,一头走下去不就完了嘛。
虽然,我朋友说的有道理,但我不是赞同。
因为,如果不是当时我自己想清楚了我要什么,我会进的了UBC,我会有今天这样的我嘛?
虽然,我没有想清楚如何去面对。
但我最近想明白一个道理,也就一句话吧,最近老说。呵呵!“人嘛,想干啥就干啥,最主要是高兴就好咯,能让自己高兴的事儿啊就去干,在难在苦也值了。”
来温哥华2年的生活,让我变得成熟了。
后来的一年,让我变得油滑了(对人,对生活的态度)。
最近,我还发现自己又变了,
我发现,我变坚强了。
海 温哥华 2008年6月28 夜
March 05 updatingI have not gone to my space for a long time. Here is some happy moments wanna share with you guys.
Good good study ...happy happy live...... November 09 Dispositions and Traits Affect the InvestigationDispositions and Traits Affect the Investigation In†A Jury of Peers†by Susan Glaspell, the story revolves around the sudden death of John Wright. There are three men and two women participating in the investigation of the murder. By using vivid imagery and lively conversation, the story leads readers through its marvelous plot and helps them follow the evidence into solving the mystery. Instead of directly describing the primary suspect-- Mrs. Wright’s actions, thoughts and words, the author chooses to employ two other characters –two farmer-wives to portray Mrs. Wright’s traits and disposition through their discoveries, thoughts and conversation. Mrs. Wright used to be a happy, sunshiny and lively girl. After her twenty years of marriage, living an uninteresting and lonely life led her to become hopeless and isolated. The change from a happy and lively Minnie Foster to a sad and isolated Mrs. Wright is the main focus of the story; it’s what keeps the story going and what will eventually affect the outcome of the murder investigation. The prologue of the investigation began with discovering Minnie Foster used to be a cheerful, happy, sunshiny and lively girl in her younger stage. We can easily find out the traits of Minnie Foster by looking at two other characters’ talking. Mrs. Hale said: " She used to wear pretty clothes and be lively – when she was Minnie Foster, one of the town girls, singing in the choir. But that --- oh, that was twenty years age."(177) We also can find out this trait by asking ourselves why she wants to have a bird. Bird is a beautiful thing that usually delights people who are artistically inclined. Its voice is sweet. She thinks she is a bird who is beautiful, and sweet, who lives without worries and sings everyday. "She---come to think of it, she was kind of like a bird herself. Real sweet and pretty, but kind of timid and---fluttery. How---she---did---change."(181) By looking at the big change of Minnie Foster during the twenty years she was married, many questions appear in the two women’s heads. How does she change? Why does she change? Why does she kill her husband? "Do you think she—did it?" (178) "How---she---did---change."(181) This important discovery looks like a kindling, which lights up a torch and leads both women to keep walking deeper into the mystery. After she got married, her first trait starts to disappear. The two investigative women start to see things from the perspective of the woman who suffered twenty years of injustice in a marriage with a man who humiliated and isolated her. In the story, Mrs. Wright becomes frugal housewife after she got married. As every woman did at that time, in her twenty years of marriage, she took care of her husband, did the farm work, cleaned and cooked meals everyday. The sentence from text shows that Mrs. Wright is very careful with her husband’s money and never spent too much. "Wright was close!" she exclaimed, holding up a shabby black skirt that bore the marks of much making over. "I think maybe that’s why she kept so much to herself." (177) I also think Mrs. Wright is a practical housewife. "They returned to an inspection of the block for the quilt. Mrs. Hale was looking at the fine, even sewing, and preoccupied with thoughts of the woman who had done that sewing." (179) Because of her practicality and frugality, the action of piecing a quilt brings another uncertainty to both women. "Why, she was piecing a quilt," and held up a large sewing basket piled high with quilt pieces. (179) When both women look at Mrs. Wright’s pieced quilt, they discover important evidence. "The sewing," said Mrs. Peters, in a troubled way, "All the rest of them have been so nice and even—but---this one. Why, it looks as if she did not know what she was about!" (179) This evidence makes them to think she is using this to kill her husband or not. But at this time, they are not quite sure about it. By discovering the ashamed, isolated, and hopeless Mrs. Wright leads the two women to find out the finial mystery of the investigation. Mrs. Wright is ashamed with her life. In the text, she does not talk with other people in town very often. This disposition leads her to lose contact with society, so she becomes isolated and lonely. "Oh, I wish I’d come over here once in a while!" she cried. (183) "I might ‘a’ known she needed help!" (183) These words show Mrs. Wright is a very lonely person. In her life, she does not have many friends, no one to talk to, and no one to rely on. As a normal person living in the world, we all have someone who we can talk to and share our sadness and happiness with. Intimates we have enrich our lives. But in Mrs. Wright’s life, the only thing she can turn to is her bird. The bird’s beautiful singing gives her a little hope to continue her poor and hard life. "She liked the bird," said Martha Hale. (182) From Martha’s words, we can deduct that she treats that bird like her only friend or maybe like her child. Children bring laughter and hope to a family but, unfortunately, Mrs. Wright does not have a baby. At last, because her husband kills her bird, which is her only intimate, her life becomes hopeless and impassive. When the two women discover the dead bird, which has been killed by her husband, they find out the last and the most significant trait of Mrs. Wright. She loses contact with society and feels isolated and alone. Years and years of unchangeable life makes her become hopeless and passionless. This gives the final answer to both women in the question as to why she killed her husband. In the beginning, a happy, sunshiny girl becomes a killer after her twenty years marriage. The big difference gives two women a question to answer. Then the practical and frugal housewife’s sewing gives Mrs. Hale and Mrs. Peters a key to solve the mystery. At last, ashamed, isolated, and hopeless Mrs. Wright leads the two women who finally found out the true motive that forced her to kill her husband. But by looking and understanding all these things about Mrs. Wright, the jury of her peers decides she is not guilty of any crimes; that she only pays back to the man what he deserves.
Works Cited Susan Glaspell A Jury of Her Peers. Literature: An Introduction to Reading and Writing. Ed.Edgar V.Roberts and Herry E. Jacobs. 8th ed. Saddle River: Prentice Hall, 2007. P172-184. |
|
||||
|
|