-
兩臺處理機A 和B處理n個作業。設第i個作業交給機器
A 處理時需要時間ai,若由機器B 來處理,則需要時間bi。由于各作
業的特點和機器的性能關系,很可能對于某些i,有ai >=bi,而對于
某些j,j!=i,有aj<bj。既不能將一個作業分開由兩臺機器處理,也沒
有一臺機器能同時處理2 個作業。設計一個動態規劃算法,使得這兩
臺機器處理完成這n 個作業的時間最短(從任何一臺機器開工到最后
一臺機器停工的總時間)。研究一個實例:(a1,a2,a3,a4,a5,a6)=
(2,5,7,10,5,2);(b1,b2,b3,b4,b5,b6)=(3,8,4,11,3,4)
標簽:
處理機
機器
上傳時間:
2014-01-14
上傳用戶:獨孤求源
-
Instead of finding the longest common
subsequence, let us try to determine the
length of the LCS.
Then tracking back to find the LCS.
Consider a1a2…am and b1b2…bn.
Case 1: am=bn. The LCS must contain am,
we have to find the LCS of a1a2…am-1 and
b1b2…bn-1.
Case 2: am≠bn. Wehave to find the LCS of
a1a2…am-1 and b1b2…bn, and a1a2…am and
b b b
b1b2…bn-1
Let A = a1 a2 … am and B = b1 b2 … bn
Let Li j denote the length of the longest i,g g
common subsequence of a1 a2 … ai and b1 b2
… bj.
Li,j = Li-1,j-1 + 1 if ai=bj
max{ L L } a≠b i-1,j, i,j-1 if ai≠j
L0,0 = L0,j = Li,0 = 0 for 1≤i≤m, 1≤j≤n.
標簽:
the
subsequence
determine
Instead
上傳時間:
2013-12-17
上傳用戶:evil
-
最長公共子序列 問題ACM題目
如果序列 { s1, s2, ……, sk } 是序列 { a1, a2, ……, an } 的子序列,又是序列 { b1, b2, ……, bm } 的子序列,則稱序列 s 為序列 a 和 序列 b 的公共子序列。在 a 和 b 的所有公共子序列中,長度最長者稱為最長公共子序列。
本題對于給定的兩個整數序列,請求其最長公共子序列的長度
標簽:
序列
ACM
sk
an
上傳時間:
2017-07-14
上傳用戶:s363994250
-
Two scripts are included here.
1. convsys.m - combines the state space representation of two systems connected in series.
[Ao,Bo,Co,Do]=convsys(A1,b1,C1,D1,A2,B2,C2,D2)
This algorithm gives the convolution of two state space representations
| A1 b1 | | A2 B2 |
u ==> | | ==> | | ==> y
| C1 D1 | | C2 D2 |
The algorithm also accepts state space objects as inputs and gives out a state space object as output.
2. sysfeedbk.m
[Ao,Bo,Co,Do]=convsys(A1,b1,C1,D1,A2,B2,C2,D2)
Gives the closed loop state space representation for two systems connected with negative feedback in the following manner.
| A1 b1 |
u ==> | | ==> y
+ o | C1 D1 | |
- | |
| | A2 B2 | |
|= | |= |
| C2 D2 |
The zip file also contains checkcompatibility.m , which checks the compatibility of matrix dimensions in the system and cleanss.m which can be used to clean a state space representation.
標簽:
representation
included
combines
scripts
上傳時間:
2017-07-25
上傳用戶:semi1981
-
題目:古典問題:有一對兔子,從出生后第3個月起每個月都生一對兔子,小兔子長到第三個月后每個月又生一對兔子,假如兔子都不死,問每個月的兔子總數為多少?
//這是一個菲波拉契數列問題
public class lianxi01 {
public static void main(String[] args) {
System.out.println("第1個月的兔子對數: 1");
System.out.println("第2個月的兔子對數: 1");
int f1 = 1, f2 = 1, f, M=24;
for(int i=3; i<=M; i++) {
f = f2;
f2 = f1 + f2;
f1 = f;
System.out.println("第" + i +"個月的兔子對數: "+f2);
}
}
}
【程序2】
題目:判斷101-200之間有多少個素數,并輸出所有素數。
程序分析:判斷素數的方法:用一個數分別去除2到sqrt(這個數),如果能被整除, 則表明此數不是素數,反之是素數。
public class lianxi02 {
public static void main(String[] args) {
int count = 0;
for(int i=101; i<200; i+=2) {
boolean b = false;
for(int j=2; j<=Math.sqrt(i); j++)
{
if(i % j == 0) { b = false; break; }
else { b = true; }
}
if(b == true) {count ++;System.out.println(i );}
}
System.out.println( "素數個數是: " + count);
}
}
【程序3】
題目:打印出所有的 "水仙花數 ",所謂 "水仙花數 "是指一個三位數,其各位數字立方和等于該數本身。例如:153是一個 "水仙花數 ",因為153=1的三次方+5的三次方+3的三次方。
public class lianxi03 {
public static void main(String[] args) {
int b1, b2, b3;
標簽:
java
編程
上傳時間:
2017-12-24
上傳用戶:Ariza
-
簡單的實現JPEG圖像壓縮編碼方法一
clear all;
RGB=imread('C:\Users\Administrator\Desktop\123.bmp');%讀取內存中bmp格式的彩色圖像
I=rgb2gray(RGB);%將彩色圖像轉換為灰度圖像
I1=im2double(I);%將圖像變換為雙精度格式
T=dctmtx(8);%處理后返回一個8*8階的DCT矩陣
b1=blkproc(I1,[8
8],'P1*x*P2',T,T');%對圖像的每個8*8子塊應用矩陣式‘P1*x*P2(像素塊的處理函數,x是形式參數)進行處理,P1=T,P2=T’
mask=[1 1 1 1 0 0
0 0
1 1 1 0 0 0 0 0
1 1 0 0 0 0 0 0
1 0 0 0 0 0 0 0
0 0 0 0 0 0 0 0
0 0 0 0 0 0 0 0
0 0 0 0 0 0 0 0
0 0 0 0 0 0 0 0 ];%選取10個DCT系數重構圖像(DCT具有能量集中的性質,數據集中在左上角,故進行圖像壓縮時離散余弦變換矩陣可以舍棄右下角的高頻數據)
B2=blkproc(b1,[8
8],'P1.*x',mask);%舍棄每個塊中的高頻系數,達到壓縮的目的
I2=blkproc(B2,[8
8],'P1*x*P2',T',T);%余弦反變換,重構圖像
subplot(2,2,1);imshow(RGB);%原彩色圖像
subplot(2,2,2);imshow(I);%灰度圖像
subplot(2,2,3);imshow(I1);%雙精度灰度圖像
subplot(2,2,4);imshow(I2);%重構圖像
標簽:
matlab
上傳時間:
2018-03-15
上傳用戶:wlmelody
-
LTE重選及切換算法參數
A1,A2,b1,B2 ....
標簽:
LTE
算法
參數
上傳時間:
2019-01-01
上傳用戶:hzsc
-
FPGA片內FIFO讀寫測試Verilog邏輯源碼Quartus工程文件+文檔說明,使用 FPGA 內部的 FIFO 以及程序對該 FIFO 的數據讀寫操作。FPGA型號Cyclone4E系列中的EP4CE6F17C8,Quartus版本17.1。timescale 1ns / 1ps//////////////////////////////////////////////////////////////////////////////////module fifo_test( input clk, //50MHz時鐘 input rst_n //復位信號,低電平有效 );//-----------------------------------------------------------localparam W_IDLE = 1;localparam W_FIFO = 2; localparam R_IDLE = 1;localparam R_FIFO = 2; reg[2:0] write_state;reg[2:0] next_write_state;reg[2:0] read_state;reg[2:0] next_read_state;reg[15:0] w_data; //FIFO寫數據wire wr_en; //FIFO寫使能wire rd_en; //FIFO讀使能wire[15:0] r_data; //FIFO讀數據wire full; //FIFO滿信號 wire empty; //FIFO空信號 wire[8:0] rd_data_count; wire[8:0] wr_data_count; ///產生FIFO寫入的數據always@(posedge clk or negedge rst_n)begin if(rst_n == 1'b0) write_state <= W_IDLE; else write_state <= next_write_state;endalways@(*)begin case(write_state) W_IDLE: if(empty == 1'b1) //FIFO空, 開始寫FIFO next_write_state <= W_FIFO; else next_write_state <= W_IDLE; W_FIFO: if(full == 1'b1) //FIFO滿 next_write_state <= W_IDLE; else next_write_state <= W_FIFO; default: next_write_state <= W_IDLE; endcaseendassign wr_en = (next_write_state == W_FIFO) ? 1'b1 : 1'b0; always@(posedge clk or negedge rst_n)begin if(rst_n == 1'b0) w_data <= 16'd0; else if (wr_en == 1'b1) w_data <= w_data + 1'b1; else w_data <= 16'd0; end///產生FIFO讀的數據always@(posedge clk or negedge rst_n)begin if(rst_n == 1'b0) read_state <= R_IDLE; else read_state <= next_read_state;endalways@(*)begin case(read_state) R_IDLE: if(full == 1'b1) //FIFO滿, 開始讀FIFO next_read_state <= R_FIFO; else next_read_state <= R_IDLE; R_FIFO: if(empty == 1'b1)
標簽:
fpga
fifo
verilog
quartus
上傳時間:
2021-12-19
上傳用戶:20125101110
-
基于Xilinx ISE的的模塊化設計示例下面是本人初學時關于模塊化設計寫的一篇博文,實例也都是自己寫的,希望給大家一個參考,代碼可能還不夠規范,比如說每一個寄存器的連線并不是都很明確的在代碼中體現出來,但是整體的設計思想還是可以借鑒的。模塊化設計應用1輸入八路十六位數據分別為a1,b1,a2,b2,a3,b3,a4,b4,將其中的a1、b1,a2、b2,a3、b3,a4、b4,分別相乘,然后將乘積相加,相加結果即為該設計的輸出。以下是模塊化設計工程的資源管理窗口中頂層模塊和子模塊的層次關系:
標簽:
xilinx
ise
模塊
fpga
設計
示例
上傳時間:
2022-04-30
上傳用戶:kent
-
本文首先介紹了衛星導航接收機的發展現狀與趨勢。接著對比分析了現如今主流的接收機技術:超外差式、零中頻式、低中頻式及數字中頻式結構,介紹了各結構的拓撲結構并對比了相互之間的優缺點,然后根據b1導航信號的特征參數要求,確定本文接收機所采用低中頻結構的技術指標。結合選擇的芯片參數搭建系統仿真模型,利用系統仿真軟件ADS對接收機前端鏈路進行行為級仿真,驗證設計方案的可行性,分模塊設計了接收機前端系統的各功能電路,主要有多級低噪聲放大器、選頻濾波電路、本振電路、混頻器電路以及系統自動增益控制電路。針對衛星導航信號接收機前端必須具備高靈敏度、強選擇性以及一定動態范圍的特點,需要平衡設計低噪聲放大器噪聲性能與單級增益,以及折中接收機前端鏡像頻率抑制性能與信道的選擇性。利用仿真軟件輔助設計了電路原理圖與印刷電路板版圖,對其PCB貼片后進行測試與調試。最后將調試好的模塊級聯成系統,測試射頻前端系統的性能并加以冊NWL.Clogin.com最終實現的接收機射頻前端5V電壓供電,接收信號中心頻率1561.098MHz,鏈路最大增益為122dB,系統噪聲小于2dB.中頻信號中心頻率46.1MHz,帶寬為4.3MHz,紋波在1.5dB內,帶外抑制與鏡像抑制都大于30dB,端口駐波比小于2.0,測試結果基本滿足設計指標要求。
標簽:
北斗二代導航系統
接收機
射頻前端
上傳時間:
2022-06-20
上傳用戶: