- 博客(22)
- 收藏
- 关注
原创 多周期CPU设计与实现实验
小火龙每年都会对实验内容进行一定的修改,以下实验仅为16年报告 代码下载 一. 实验目的 (1) 认识和掌握多周期数据通路原理及其设计方法; (2) 掌握多周期CPU的实现方法,代码实现方法; (3) 编写一个编译器,将MIPS汇编程序编译为二进制机器码; (4) 掌握多周期CPU的测试方法; (5) 掌握多周期CPU的实现方法。二. 实验内容 设计一个多周期CPU,该CP...
2018-07-24 19:44:03 6186 1
原创 单周期CPU设计实验
小火龙每年都会改一下实验内容,以下内容仅16年的实验。 代码下载 一. 实验目的 (1) 掌握单周期CPU数据通路图的构成、原理及其设计方法; (2) 掌握单周期CPU的实现方法,代码实现方法; (3) 认识和掌握指令与CPU的关系; (4) 掌握测试单周期CPU的方法; (5) 掌握单周期CPU的实现方法。二. 实验内容 设计一个单...
2018-07-24 17:03:03 7937 1
原创 Weak15 Sklearn Homework
代码:import sklearnfrom sklearn import datasetsfrom sklearn import cross_validationfrom sklearn.naive_bayes import GaussianNBfrom sklearn.svm import SVCfrom sklearn.ensemble import RandomFore...
2018-06-17 02:37:19 214
原创 Weak14 Jupyter homework
%matplotlib inlineimport randomimport numpy as npimport scipy as spimport pandas as pdimport matplotlib.pyplot as pltimport seaborn as snsimport statsmodels.api as smimport statsmodels.form...
2018-06-09 20:16:06 261 2
原创 Weak13 Scipy Homework
代码:import numpy as npimport matplotlib.pyplot as pltfrom scipy.optimize import leastsqm=10n=4A = np.random.randint(1,10,(m,n))b = np.random.randint(1,10,(m,1))x = np.random.randint(1,10,...
2018-06-03 17:04:00 176
原创 Weak12 Matplotlib Homework
代码:import numpy as npimport matplotlib.pyplot as pltimport seaborn as snsx = np.linspace(0,2,1000)y = np.power(np.sin(x-2),2)*np.exp(-np.power(x,2))plt.plot(x,y,'g-',label='$sin^2(x-2)e^-x^...
2018-05-25 21:36:27 264
原创 Weak11 Numpy Homework
为了显示方便,n=4,m=10 代码:import numpy as npfrom scipy.linalg import toeplitzimport randomn=4m=10A = np.random.normal(0,1,n*m)A = A.reshape(n,m)B = toeplitz(list(range(1,m+1)))print("A=",A)pr...
2018-05-19 20:51:37 358
原创 37. Sudoku Solver
这题难度为困难,目前通过率为32.2%题目:Write a program to solve a Sudoku puzzle by filling the empty cells.A sudoku solution must satisfy all of the following rules:1.Each of the digits 1-9 must occur exactly ...
2018-04-28 23:09:29 130
原创 36. Valid Sudoku
这题难度为中等,目前通过率为37.7%题目:Determine if a 9x9 Sudoku board is valid. Only the filled cells need to be validated according to the following rules:1.Each row must contain the digits 1-9 without repetit...
2018-04-28 22:55:01 128
原创 665. Non-decreasing Array
这题难度为简单,目前通过率为20.3%题目:Given an array with n integers, your task is to check if it could become non-decreasing by modifying at most 1 element.We define an array is non-decreasing if array[i] <...
2018-04-24 18:41:11 106
原创 15. 3Sum
这题难度为中等,目前通过率为21.8%题目:Given an array nums of n integers, are there elements a, b, c in nums such that a + b + c = 0? Find all unique triplets in the array which gives the sum of zero.Note:The ...
2018-04-24 17:32:47 152
原创 Weak6 Chapter11 Homework
11-1 城市和国家 city_functions.pydef get_city_country (city,country): return city+","+countrytest_cities.pyfrom city_functions import get_city_countryimport unittestclass NameTestCase (un...
2018-04-11 00:11:03 204
原创 Weak5 Chapter10 Homework
10-1 Python学习笔记 learning_python.txtIn Python you can be angryIn Python you can be excitedIn Python you can say nothingmain.pywith open('learning_python.txt') as file: print("打印整个文件") ...
2018-04-05 00:04:41 272
原创 Weak5 Chapter9 Homework
9-1 餐馆class Restaurant(): def __init__(self,name,type): self.restaurant_name = name self.cuisine_type = type def describe_restaurant(self): print("餐馆名:"+self.resta...
2018-04-02 20:19:12 153
原创 Weak4 Chapter8 Homework
8-2 喜欢的图书def favourite_book(title): print("One of my favourite books is "+title)favourite_book("Alice in Wonderland")输出结果是:One of my favourite books is Alice in Wonderland8-3,8-4 T恤...
2018-03-30 13:16:03 133
原创 Weak4 Chapter7 Homework
7-2 餐馆定位i = int(input("请问有多少人用餐? "))while i > 0: if i > 8: print("目前没有空桌") else: print("目前有空桌") i = int(input("请问有多少人用餐? "))输出结果是:请问有多少人用餐? 5目前有空桌请问有多少人用餐...
2018-03-27 14:52:47 183
原创 Weak3 Chapter6 Homework
6-2 喜欢的数字numbers ={'carol':6,'jen':2,'sarah':4,'edward':9,'phil':1}for k,v in numbers.items(): print(k.title()+"'s favourite number is "+str(v))输出结果为:Carol's favourite number is 6Jen's...
2018-03-22 00:05:05 183
原创 Weak3 Chapter5 Homework
5-2 更多的测试条件#检查字符串相等和不等,lower()的测试cars = ["audi","BMW","Subaru","toyato"]for car in cars: if car.lower() == 'bmw': print(car.upper()) else: print(car.title())#检查特定值在不在列表...
2018-03-21 13:57:47 148
原创 Weak2 Chapter4 Homework
4-1 披萨kinds =["apple","banana","orange"]for kind in kinds: print("I like "+kind+" pizza")print("I really love pizza!")输出结果:I like apple pizzaI like banana pizzaI like orange pizz
2018-03-17 21:30:44 163
原创 Weak2 Chapter3 Homework
3-1 姓名names = ["Smith","Napoleon","Alexander","Lenin","Stalin"]for name in names: print(name)输出结果为:SmithNapoleonAlexanderLeninStalin3-2 问候语names = ["Smith","Napoleon&
2018-03-13 00:02:06 149
原创 Weak1 浏览Python主页 and 目标
Python主页一进去用了五段代码简单展示了这种语言的特性,其中有一段代码吸引了我的注意def fib(n): a,b = 0,1 while a < n: print(a,end=" ") a,b = b,a+bfib(1000)0 1 1 2 3 5 8 13 21 34 55 89 144 233 377 610 987 ...
2018-03-10 21:35:24 160
原创 Weak1 Chapter2 Homework
2-1 简单消息message = "Hello world"print(message)output:Hello world2-2 多条简单消息message = "Hello world"print(message)message = "World hello"print(message)output:Hello worldWorld hello2-3 个性化消息name = "...
2018-03-07 22:54:44 252
空空如也
空空如也
TA创建的收藏夹 TA关注的收藏夹
TA关注的人