上一页 1 ··· 4 5 6 7 8 9 10 11 12 13 下一页

2011年7月11日

[笔记]再笔记--边干边学Verilog HDL --001

摘要: 缘起 偶然,借到块DE2,开始学习Verilog HDL,也是从语法看起,照着书上敲代码,仿真,做lab,下载,貌似入门了,但总是不确定,总是觉得不能把握什么。偶然看到akuei2的《Verilog哪些事儿--建模篇》V4,觉得很好,遂想记录“打谱”的点滴--是为再笔记。Lab 1 永远的流水灯 这名字是直接拿来的,起的太好了,不多言。 这个实验想阐述并行的思想,用4个类似的模块建立1个并行操作的流水灯模块。每隔100ms流动一下。代码:led0_module.v 1 /** 2 * File name: led0_mocule.v 3 * 4 */ 5 6 module led0_modul 阅读全文

posted @ 2011-07-11 18:42 yf.x 阅读(1776) 评论(4) 推荐(0)

2011年7月2日

【原创】如何使用DE2的1602LCD --之一(quartus)(verilog)(digital logic)

摘要: 1. 缘起 会了点HDL和数字逻辑基础后,操作DE2上的开关,led,7断码数码管都没啥问题,但至此好像也只能玩玩n年前教科书上都有的lab,啥数字钟,汽车尾灯,交通灯之类。浪费了DE2的资源,未免对不起DE2的价钱。板子上最明显的东东莫过于那个1602的LCD了,遂想玩玩这个东东。伟大的教育培养的惯性思维:照书本来,狗来狗去,国产的似乎就只有一本关于DE2的书(上交的一个博士写的),拜读一下,大半是DE2附带的光盘lab的中译版,。。。总之,DE2的玩法,没在这本书里找到,估计又是应付国内职评的产物。没期望过,所以没啥失望,好在web上tw的教育网页可打开,那边的学生都推荐OO无双说过的那两 阅读全文

posted @ 2011-07-02 21:01 yf.x 阅读(7481) 评论(3) 推荐(2)

2011年6月17日

【笔记】Stanford OpenCourse—CS106A:Programming Methodology—006

摘要: Assignment 2: Simple Java ProgramsProblem 1: Brick Pyramids 这题要求画个图1所示的类似金字塔的东东,主要是使用getWidth(),和getHeitht(). 图 1 1 /*File pyramid.java 2 * this program draws a pyramid 3 * Programming exercise 1 cs106a stanford: 4 * Assignment #2: Simple Java Programs 5 * Write a GraphicsProgram subclass that draws 阅读全文

posted @ 2011-06-17 15:11 yf.x 阅读(1587) 评论(0) 推荐(1)

2011年6月13日

【笔记】Eclipse and Java for Total Beginners—016

摘要: Lesson 16 – Create main Method and JAR FileIntroduce main methodWrite a main methodRun MyLibrary as Java applicationExport to JAR file and run from Windows在MyLibrary.java里添加main method。 1 public static void main(String[] args) { 2 // create a new MyLibrary 3 MyLibrary testLibrary = new MyLibrary(&qu 阅读全文

posted @ 2011-06-13 15:29 yf.x 阅读(337) 评论(0) 推荐(1)

【笔记】Eclipse and Java for Total Beginners—015

摘要: Lesson 15 – Finish MyLibrary MethodsCreate test for getAvailableBooksCreate getAvailableBooksCreate getUnavailableBooks 1 package org.totalbeginner.tutorial; 2 3 import java.util.ArrayList; 4 5 import org.omg.CORBA.PUBLIC_MEMBER; 6 import org.totoalbeginner.tutorial.Person; 7 8 import junit.framewor 阅读全文

posted @ 2011-06-13 14:29 yf.x 阅读(372) 评论(0) 推荐(1)

【笔记】Eclipse and Java for Total Beginners—014

摘要: Lesson 14 – Finish checkOut MethodWrite getBooksForPerson methodIntroduce for each loopIntroduce logical ‘and’ operator &&NullPointerException errorsComplete checkOut Method 1 package org.totalbeginner.tutorial; 2 3 import java.util.ArrayList; 4 5 import org.totoalbeginner.tutorial.Person; 6 阅读全文

posted @ 2011-06-13 10:26 yf.x 阅读(305) 评论(0) 推荐(1)

【笔记】Eclipse and Java for Total Beginners—013

摘要: Lesson 13 – Continue checkOut MethodTest checkOut, checkIn methodsFix compiler error – misplaced {}Add test for maximum booksCreate test for getBooksForPerson() methodRefactoring – extrack method 1 package org.totalbeginner.tutorial; 2 3 import java.util.ArrayList; 4 5 import org.omg.CORBA.PUBLIC_ME 阅读全文

posted @ 2011-06-13 09:50 yf.x 阅读(262) 评论(0) 推荐(0)

【笔记】Eclipse and Java for Total Beginners—012

摘要: Lesson 12 – Create checkOut, checkIn MethodsCreate test for checkOut, checkIn methodsWrite checkout methodIntroduce if / then / else syntaxIntroduce boolean methodWrite checkIn method1. testCheckOut Method Test both the checkOut and checkIn methodsCheck Out a bookCheck Out second bookCheck in a book 阅读全文

posted @ 2011-06-13 08:51 yf.x 阅读(338) 评论(0) 推荐(0)

2011年6月12日

【笔记】Eclipse and Java for Total Beginners—011

摘要: Lesson 11 – Create first methods in MyLibrary classCreate test method for addBook, removeBook methodsCreate addBook, removeBook methods and testCreate addPerson, removePerson methodsIntroduce Eclipse refactoring – move local variable to field 1 package org.totalbeginner.tutorial; 2 3 import java.uti 阅读全文

posted @ 2011-06-12 15:44 yf.x 阅读(323) 评论(0) 推荐(0)

【笔记】Eclipse and Java for Total Beginners—010

摘要: Lesson10 – Start on MyLibrary ClassCreate MyLibrary Test JUnit testCreate testMyLibrary to test MyLibrary constructorCreate MyLibrary constructorIntroduce instanceof operatorIntroduce assertTrue method 1 package org.totalbeginner.tutorial; 2 3 import java.util.ArrayList; 4 5 import junit.framework.T 阅读全文

posted @ 2011-06-12 14:41 yf.x 阅读(270) 评论(0) 推荐(0)

2011年6月11日

【笔记】Eclipse and Java for Total Beginners—009

摘要: Lesson 09 – MyLibrary Class and ArrayListHow can we hold books, etc. in a collection?MyLibrary object to hold Person & Entry objectsIntroduce ArrayList in scrapbookIntroduce Java GenericsMethod chaining使用ArrayList前,要添加java.util. 1 ArrayList<Book> list = new ArrayList<Book>(); 2 3 Boo 阅读全文

posted @ 2011-06-11 21:07 yf.x 阅读(397) 评论(0) 推荐(0)

【笔记】Eclipse and Java for Total Beginners—008

摘要: Lesson 08 – Add Person to Book ClassCreate a relationship between the Book class and the Person classTest getPerson methodCreate JUnit Test Suite1. 本课的任务目前,已创建Person class 和 Book class。需要显示哪个人借了哪本书。要创建Book 和Person之间的关联。仍用test-first方法。2. 步骤 打开BookTest,添加method.创建testGetPerson() method.创建getPerson() m 阅读全文

posted @ 2011-06-11 13:40 yf.x 阅读(300) 评论(0) 推荐(0)

2011年6月10日

【笔记】Eclipse and Java for Total Beginners—007

摘要: Lesson 07 – Create Book ClassCreate BookTest before creating Book classTest Book constructorCreate get and set methods1. 新建一个JUnit test case, name为BookTest, Class under test为空,因为尚未建Book class.2. 建立Book class, 注意目录为src。3. Test-first approach to Book classCreate BookTest class.Create testBook() method 阅读全文

posted @ 2011-06-10 16:38 yf.x 阅读(386) 评论(0) 推荐(0)

【笔记】Eclipse and Java for Total Beginners—006

摘要: Lesson 06 – Using Test-First Development in EclipseUse test-first approach to write the Person toString() methodMethod overridingField Hiding1. toString() methodinherited from Object classreturns a String representation of the objectnormally create for every class2. Test-driven developmentThink abou 阅读全文

posted @ 2011-06-10 15:32 yf.x 阅读(236) 评论(0) 推荐(0)

【笔记】Eclipse and Java for Total Beginners—005

摘要: Lesson 05 – JUnit Testing ContinuedTest Person class – part 2Create test methods for constructor, getName, and getMaximumBooksStatic methods 这里的assertEquals是Static method.当其在所属的Class内部时,可略写Class。 1 package org.totalbeginner.tutorial; 2 3 import org.totoalbeginner.tutorial.Person; 4 5 import junit.fr 阅读全文

posted @ 2011-06-10 09:25 yf.x 阅读(264) 评论(1) 推荐(1)

2011年6月9日

【笔记】Eclipse and Java for Total Beginners—004

摘要: Lesson 04 – JUnit Testing in Eclipse, Part 1Create test source folderCreate Person Test classRun first JUnit test1. Scrapbook的优/缺点Great for exploring new Java classes and trying commmands.Does not let you automate testing2. Unit Testing的特点Automated testing of all methodsVery valuable when making cha 阅读全文

posted @ 2011-06-09 17:45 yf.x 阅读(358) 评论(0) 推荐(0)

【笔记】Eclipse and Java for Total Beginners—003

摘要: Lesson 03 – Use Eclipse ScrapbookIntroduce Eclipse ScrapbookIntroduce Java expressions, statementsDiscuss Java packagesCreate Person Object in Scrapbook1. 打开Scrapbook RC project / New / other / Java / Java Run/Debug / Scrapbook.page / Next / MyScrapbook (name) / Finish.2. Scrapbook的作用 Scrapbook allo 阅读全文

posted @ 2011-06-09 15:36 yf.x 阅读(261) 评论(0) 推荐(0)

【笔记】Eclipse and Java for Total Beginners—002

摘要: Lesson 02 – Add Methods To ClassIntroduce Eclipse Views and PerspectivesIntroduce Eclipse user interface – drag / drop, cnntext menus, helpAdd get and set methods to Person class1. 自动提示或补充标识符。 英文版的系统用Ctrl+Space, 中文版的系统用Alt+/。2. Parameters and Fields.3. this this = the current object4. Class members 阅读全文

posted @ 2011-06-09 14:51 yf.x 阅读(270) 评论(0) 推荐(0)

【笔记】Eclipse and Java for Total Beginners—001

摘要: 偶然搜到Mark Dexter的这个免费视频(http://eclipsetutorial.sourceforge.net/totalbeginner.html)。够傻瓜,够直观。慢慢习之。Lesson 01 – Create Your First Java ClassCreate Java project in EclipseCreate Java package Introduce classes and objects, naming conventionsWrite a simple Java class (Person)Create Java project in Eclipse . 阅读全文

posted @ 2011-06-09 10:57 yf.x 阅读(393) 评论(0) 推荐(0)

2011年6月8日

【笔记】Stanford OpenCourse—CS106A:Programming Methodology—005

摘要: ch04 Programming Exercise1. 1 /** 2 * File: Ex4_1.java 3 * ---------------- 4 * This program is to generate the lyrics . 5 * 6 * @author Administrator 7 * 8 */ 9 import acm.program.*;10 11 public class Ex4_1 extends ConsoleProgram {12 13 public void run() {14 15 for (int i=n; i>0; i--){16 println 阅读全文

posted @ 2011-06-08 21:06 yf.x 阅读(636) 评论(0) 推荐(0)

上一页 1 ··· 4 5 6 7 8 9 10 11 12 13 下一页

导航