同一個數會由于采用不同的基數而使得其表現的形式是完全不一樣的,在我們的學習中,我們熟悉的基數有10進制、12進制、60進制、2進制、8進制和16進制。比如數據12,如果我們用2進制表示,則它就是1100;如果用3進制表示就是110;如果用8進制表示則是14。我們的編程任務就是與數的進制(也就是基數)有關。 程序中我們會給大家很多個數對(假設每個數對的數用X和Y表示),程序需要解決的問題就是為X和Y各選擇一個最小的基數,以使得這兩個數在其選擇的基數上是一對相等的數。 例如,12和5這個數對,我們可以為12選擇基數3,為5選擇基數6,這樣一來12(base 3)=5(base 6),因為12(base 3)就是10進制數5,而5(base 6)也是10進制數中的5。 程序的輸入是通過文件完成的。 文件中的每一行都包含一個數對X和Y,兩個數通過一個或多個空格符分割,與X和Y相關聯的有效基數值范圍為2~36。X和Y的合理數值表示字符包括0—9和A-Z(表示數值10-35)。 文件的最后一行用一個數字0表示輸入的結束。
標簽:
上傳時間: 2013-12-17
上傳用戶:skfreeman
m16+cp2200組成的網絡接口。 m16使用內部RC振蕩8M,如果要提高主頻,請注意修改模擬總線讀函數。 cp2200模塊使用www.icdev.com.cn的,更改pin44連接VCC,即總線復用方式,地址數據復用。 軟件編寫使用avrstudio4.12+sp4+winavr(avrstudio自帶的winavr嵌入方式)。 硬件連接: m16 | cp2200 PORTA | AD0-7 PB0 | RST PB1 | CS PB2 | RD PB3 | WR PD2 | INT PD3 | ALE(A3) 由于采用的是m16做為主控,只能使用總線模擬方式,其讀寫速度有限,經測試約為雙向11.8kBps(90kbps)。 由于ram有限,僅僅采用了332Bytes的數據緩沖做為收發buffer,超過此長度的以太網包將拋棄。 此工程文件僅僅做為cp220x的一個移植范例,高級tcpip應用代碼因商業緣故不會提供,請勿找我詢問。
上傳時間: 2015-09-13
上傳用戶:zhengzg
//打開 USB 口讀寫, 由驅動程序的 Pipe 名確定 HANDLE hPipe = OpenMyDevPipe("MyPipe1") //驅動程序里面的 Pipe 名, 對應訪問某個端點的 I/O, 這里我亂寫的, 需要與驅動一致 if(hPipe != INVALID_HANDLE_VALUE) //打開 Pipe 成功 { ReadFile(hPipe, Buffer, BufSize, &nBytesRead, NULL) //從 hPipe 里讀取數據到 Buffer 里 //WriteFile(hPipe, Buffer, BytesToWrite, &nBytesWritten, NULL) //把 Buffer 里面的 BytesToWrite 字節寫入 hPipe CloseHandle(hPipe) } //使用 DeviceIoControl 訪問 USB 設備 HANDLE hDevice = OpenMyDevice() if(hDevice != INVALID_HANDLE_VALUE) //打開設備成功 { //這些 DeviceIoControl 功能都是由設備定義的, 具體看設備和驅動的資料 if(DeviceIoControl(hDevice, IOCTL_READ_xxxx, &IOBlock, sizeof(IOBLOCK), &c, 1, &nBytes, NULL)) { //成功 } CloseHandle(hDevice) }
標簽: Pipe OpenMyDevPipe MyPipe1 HANDLE
上傳時間: 2014-11-25
上傳用戶:stampede
BNB20 Finds the constrained minimum of a function of several possibly integer variables. % Usage: [errmsg,Z,X,t,c,fail] = % BNB20(fun,x0,xstatus,xlb,xub,A,B,Aeq,Beq,nonlcon,settings,options,P1,P2,...) % % BNB solves problems of the form: % Minimize F(x) subject to: xlb <= x0 <=xub % A*x <= B Aeq*x=Beq % C(x)<=0 Ceq(x)=0 % x(i) is continuous for xstatus(i)=0 % x(i) integer for xstatus(i)= 1 % x(i) fixed for xstatus(i)=2 %
標簽: constrained variables function possibly
上傳時間: 2014-01-13
上傳用戶:youth25
Problem Statement You are given a string input. You are to find the longest substring of input such that the reversal of the substring is also a substring of input. In case of a tie, return the string that occurs earliest in input. Definition Class: ReverseSubstring Method: findReversed Parameters: string Returns: string Method signature: string findReversed(string input) (be sure your method is public) Notes The substring and its reversal may overlap partially or completely. The entire original string is itself a valid substring (see example 4). Constraints input will contain between 1 and 50 characters, inclusive. Each character of input will be an uppercase letter ( A - Z ). Examples 0) "XBCDEFYWFEDCBZ" Returns: "BCDEF" We see that the reverse of BCDEF is FEDCB, which appears later in the string. 1)
上傳時間: 2015-09-21
上傳用戶:sunjet
該文件夾包括實驗報告,流程圖,以及源代碼.程序實現功能:在主程序運行期間,每5秒鐘響鈴一次;當鍵盤上的某個鍵被按下時,主程序和響鈴都被掛起,顯示器顯示buffer緩沖區中的字符串,然后等待下一次按鍵引起的鍵盤中斷;當鍵盤中斷發生后,恢復主程序和響鈴.這一過程可以重復任意次。
標簽: 實驗報告
上傳時間: 2015-09-21
上傳用戶:xyipie
對電磁波入射的源為偶極子進行仿真,可以z作為其他電磁仿真問題中的源的設置子函數用
上傳時間: 2015-09-22
上傳用戶:ryb
This m file analyzes a coherent binary phase shift keyed(BPSK) and a amplitude shift keyed(ASK) communication system. The receiver uses a correlator(mixer-integrator[LPF]) configuration with BER measurements comparing measured and theoretical results. The bandpass and low pass used in the receiver are constructed using z transforms.
標簽: keyed shift amplitude analyzes
上傳時間: 2015-09-26
上傳用戶:liuchee
Romberg求定積分 輸入:積分區間[a,b],被積函數f(x,y,z) 輸出:積分結果
上傳時間: 2015-10-14
上傳用戶:妄想演繹師
ljd-44b0DVK-I,s3c44b0x buffer驅動程序,用 ads1.2編譯。
上傳時間: 2015-10-16
上傳用戶:15071087253