-
七种排序算法(包括直接插入排序,折半插入排序,希尔排序,冒泡排序,快速排序,简单选择排序,归并排序)
七种排序算法(包括直接插入排序,折半插入排序,希尔排序,冒泡排序,快速排序,简单选择排序,归并排序)还有两道题1./*设计并实现一个有效的对n个整数重排的算法,使得所有负数位于非负数之前,给出算法的性能分析*/2./*试给出一个同时找到n个元素中最大元素与最小元素的有效算法,并说明理由*/
- 2020-12-11下载
- 积分:1
-
STM32F103 TFT彩屏显示汉字字符(取摸 无字库)C程序
STM32F103 TFT彩屏显示汉字字符(取摸 无字库)C程序,程序包含编译后全部内容,可直接使用
- 2020-07-02下载
- 积分:1
-
基于FPGA的数字通信实现多路数据时分复用和解复用系统系统
本文档介绍了一种基于FPGA的数字通信多路时分复用和解复用系统,使用硬件描述语言很好的实现了系统功能。第2页共63页AbstractThe system is designed for data multiplexed and de-multiplexed. It is based on TDMThe systern includes the transmitter and the receiver. They are implemented mainly by FPGaThere are three inputs in the transmission system: data from A/converter, DIPI and DIP2The three channels are out serially and time-divisional under the FPgas control. The FPGain the transmitter is divided into four modules which are frequency divider, Barker generator,data multiplexer and voltage display. voltage display is used for processing the data convertedy ADC and sending it to the LED. The serial data are serial shifted into the FPGa in thereceiver. Bit-synchronize and frame-synchronize are both picked up, and then de-multiplexThe FPGA in the receiver is divided into three modules which are digital PLL, datade-multiplexer and voltage display. The transmitter will multiplex four ways of 8-bit paralleldata. The first way is adC data, the second and the third way is generated by dip-key. Theother is Barker code used for frame synchronizing. The receiver will maintain the bitsynchronizing, recognize one frame and de-multiplex three ways data. The essay will discussthe design progress, the programming idea and some problems. Works have to be done by thedesigner are: Specify all system components, Make system specification, Draw systemschematics, Write RTL code according the schematics, Synthesis and simulate the rtl codeDesign the PCBS, Validate the functions of the FPGA on-line.Keywords: DPLL; Frame-synchronize; TDM; Verilog HDl; Serial A/D convert;第3页共63页目录引1数字复接系统简介52数字复接方法及方式2.1数字复接的方法…中中·2.2数字复接的方式………3系统原理和各模块设计………………………63.1系统原理及框图…3.2发端系统设计…3.3收端系统设计…···中··中··中····中·,中………93.4FPGA的设计流程“····“:*·············=·······*·*··3.4.1设计输入···“··++··+··*+··+··+++*···++++·*·+·++34.2设计综合……………………123.4.3仿真验证123.4.4设计实现……123.4.5时序分析123.5发端FPGA设计………………………133.5.1分频模块…翻……143.5.2复接模块……………………………………153.5.3显示模块……………………163.5.4编译与仿伤真…………………183.6收端FPGA设计……………………………………………………193.6.1数字锁相模块…………···→····;··中·······中···········→··············203.6.2解复用模块…··++·*···中+“··“++………………………213.6.3显示模块………………………………………………223.6.4编译与仿真………………………………223.7数字锁相环原理及设计……………………………2338串行AD工作原理………………2539并行D/A的工作原理…263.10 Altera flex10K10介绍………………………………………………………………274系统调试…………………………………………………325 Quartus||软件及 Ver log语言简介…………325.10 artus I软件简介……………………………………………………325.2 Verilog语言简介……………………………………………………………34第4页共63页6结论····“4··+·→··*·*··“······+“·+····“······“··+·+“+·…“*·.·+··+“·+·+·*··…………35谢辞36参考文献·a···.········和··::··中.事…37附录…38docn豆丁www.oocin.com第5页共63页引言数字复接、分接技术发展到80年代已经趋于成熟,形成了完善的EI、T系列。它使得多路低速信号可以在髙速信道中传输,同时提髙信道的利用率。PLD/FPGA是电子设计领域中最具活力和发展前途的一项技术,它的影响丝毫不亚于70年代单片机的发明和使用。可以毫不夸张的讲,PID/FPGA能完成任何数字器件的功能,上至高性能CP,下至简单的74电路,都可以用PLD/FPGA来实现。PLD/FPGA如同一张白纸或是一堆积木,工程师可以通过传统的原理图输入法,或是硬件描述语言自由的设计一个数字系统。通过软件仿真,我们可以事先验证设计的正确性。在PCB完成以后,还可以利用PLD/FPGA的在线修改能力,随时修改设计而不必改动硬件电路。使用PLD/FGA来开发数字电路,可以大大缩短设计时间,减少PCB面积,提高系统的可靠性。,PLD/FGA的这些优点使得PLD/FPGA技术在90年代以后得到飞速的发展,同时也大大推动了EDA软件和硬件描述语言的进步。本设计主要利用了FPGA及 Verilog hdl语言来设计数字复、接分接系统。数字复接系统简介在数字通信网中,为了扩大传输容量和提高传输效率常常需要把若干个低速数字信号合并成为一个高速数字信号,然后再通过高速信道传输,这就是所谓的数字复接技术。数字复接是一种已经非常成熟的技术,广泛地应用于无线通信、光通信和微波接力通信。图1-1数字复接系统方框饜图1-1所示,数字复接系统包括数字复接器( digital multiplexer)和数字分接时钟「定时同定时步复分日恢接复器( digital de- multiplexer)两部分。数字复接器是把两个或多个低速的支路数字信号按照时分复用方式合并成为一路高速的合路数字信号的设备;数字分接器是把合路数字信号分解为原来的支路数字信号的设备。数字复接器是由定时、调整和复接单元所组成;数字分接器是由同步、定时、分接和恢复单元所组成。定时单元给设备提供统一的基准时间信号,同步单元给分接器提供与复接器基准时间同步的时间信号,调整单元负责同步输入的各支路信号。恢复单元与调整单元相对,负贵把分接出来的各支路信号复原第6页共63页2数字复接方法及方式2.1数字复接的方法数字复接的方法主要有按位复接、按字复接和按帧复接三种(1)按位复接按位复接的方法是每次只复接每个支路的·位码,复接后,码序列中的第·位表示第一路中的第一位码;第二位表示第二路的第一位码;以此类推,第N位表示第N路的第一位码。这N位码形成第一时隙。同样,第二时隙是有每路的第二位码复接而成。这种复接方法的特点是设备简单、只需小容量存储,易于实现(2)按字复接按字复接就是每次复接支路的一个字或字节。复接后的码顺序是每个封隙为一路n位码。它的特点是利于多路合成和处理,但要求有较大的存储容量,使得电路较为复杂(3)按帧复接这种方法是每次复接一个之路的一帧数码,它的特点是复接时不破坏原来的帧结构,有利于交换,但要求有更大的存储容量。22数字复接的方式按照复接时各低速信号的情况,复接方式可分为同步复接、异步复接与准同步复接。(1)同步复接同步复接被复接的各个支路信号在时间上是完全同步的。在实际应用中,由于各个支路信号到达的时间不一样,造成支路间的码位相位不同,使得信息不能被正确复接。因此需要对支路进行相位调整。在复接时,要插入帧同步码及其它的业务码。(2)异步复接将没有统一标称频率的不同支路数字信号进行复接的方式成为异步复接。在数字通信中广泛采用这种复接方式。(3)准同步复接准同步复接是指参与复接的各个低速信号使用各自的时钟,但各支路的时钟需要在定的容差范围内。准同步复接实际上是在同步复接的基础上增加了码速调整功能3系统原理和各模块设计3.1系统原理及框图首先介绍系统的工作过程。此数字通信系统分为发端和收端两部分。在发端,FPGA对A①D变换数据、DIP1数据和DIP2数据插入帧同步码,形成一帧,对此帧按位时分复用并串行发送出去。同时,A/D输入端的模拟电压值将通过FPGA的处理,显示在七段数码管上。在收端,FPGA首先从串行码中提取位时钟,然后识别帧同步。当识别出帧同步后,FPGA解复用三路并行码,分别将这三路并行码送到后面的D/A变换器、LED1和LED2同时,第一路并行码通过FGA的处理,显示到七段数码管上。传输帧结构如图3-1所示:第7页共63页帧同步第一路第二路|第三路图3-1传输帧结构总系统框图如图3-2所示:七段数码管七段数码管A/DD/A信道DI P1立FPGA收端FPGALED 1DIP2LED2图3-2总系统框图3.2发端系统设计图3-3是发端系统方框图七数码簣豆丁A/D信道DP1愛端FPGADIP2图3-3发端系统方框图如图3-3所示,发端有三路信号:A/D变换信号、拨码开关1和拨码开关2产生的8位信码。AD变换的信码经过FPGA处理显示到七段译码管上,它代表变换前模拟信号的电压值。由于三路信号都是静态信号,因此输入不用进行码速变挨和码速调轄。输出信号的码速率为256Kbps。发端电路在做PCB时需要单层布线,因此将发端系统板倣成三块小板,分为三个图,分别是发端主图、AD变换图和LED显示图。发端主图如34所示,以发端FPGA为核心,其它功能块逐一实现。为了FGA运行的稳定,要在其周围加入6个滤波电容,电容值为0.1uF。拨码开关与排阻共同构成八位信码,分别接到FPGA的8个I/0端口。复位电路是系统正常运行的必要部分,它由按键开关,电解电容和电阻构成。主图板与AD变换板、LED显示板之间用插针和电线连接。这些插针和电线将为A/D变换板和LED显示第8页共63页板提供电源和通信路径。此外,FPGA还需要配置电路。配置电路在开杌时将配置文件载入到FPGA中,FPGA才可以工作。配置电路由上拉电阻和插座组成,其中,五个端口接到FGA五个配置引脚,他们是:DATA0、 sTATuS、 nCONFIG、 CONF DONE与DCLK。3图AA399999温899998旨若起Ed kDYnizisr含已四=图3-4发端主图原理图A/D变换图如图35所示,要说明的是,这里没有采用并行A/D,而是采用了串行A/D,这样可以节省FPGA的管脚。我使用的ADC型号是TC549。TLC549转换输入端模拟量为数字量,为FPGA提供串行数据。这块板的电源由主图板提供,电源端接到主图板的电源端。TLC549需要一片0.1uF的陶瓷电容为芯片的电源端滤波。在做PCB时,这片电容应靠近芯片的VCC与GND。TLC549的模拟输入量有电位器分压和外部输入,通过单刀双掷开关选择。外部输入的模拟量可以是信号源输出,音频输入等。AA「区YcAy图3-5AD变换图第9页共63页LED显示图如图3-6所示,我用五位LED显示模拟电压值。它可以提供0.0001的显示精度。这五位LED由一位独立LED和一个四LED组组成。这五个LED采用扫描方式显示。扫描显示是LED显示的常用方法。通过五个PNP管控制五个LED分时发光,时隙为32ms。在此时隙下,人眼不会察觉到LED分别点亮,而是同时在亮。此法不仅节省七段译码驱动芯片和FPGA的管脚,而且节约电能。小数点的位置固定不变:因此只需将独立LED的小数点设计为常亮。LED数码管采用共阳极,公共端接PP发射极,PNP集电极接电源,PNP的导通由FPGA控制。七段译码芯片采用DM74LS47,它是一片驱动共阳极LED数码管的芯片。同样,在这片芯片的VCC与GND之间加入0.1uF陶瓷滤波电容和essOyNC 5v In图3-6LED显示图3.3收端系统设计收端系统框图如图3-7所示七段数码管D/A信道收端FPGAED1LED2图3-7收端系统框图
- 2020-12-03下载
- 积分:1
-
STM32实现交通灯设计
用Keil软件编写控制代码,使用Proteus软件仿真STM32以及LED灯、按键等硬件;交通灯有三种方案,区别在于红灯和绿灯亮的时间不一样
- 2021-05-06下载
- 积分:1
-
MFC socket编程实例MyQQ
MFC socket编程实例 MyQQMFC socket编程实例MyQQMFC socket编程实例MyQQ
- 2020-11-29下载
- 积分:1
-
原生apphtml2.rar
该demo使用h5+的功能基于android手机实现了录音,拍照,录像并进行上传下载,播放的功能,采用h5开发移动app,理论是支持android和ios的开发,开发工具采用hbuilder,利用hbuilder打包app在android机上运行,目前只测试了android机
- 2020-11-04下载
- 积分:1
-
COMSOL光学仿真专题
关于光学的COMSOL仿真分析,可以作为参照的例子进行练习InTechc0 fmod multiohydicd解决方案·几何光学粒子追踪模块波动光学RF模块W问m仿真智领创新Simulating inspires innovationInTech主要特征Luneburg透镜粒子追踪现在是可用的物理接口:一利用 COMSOL求解基于有限元问題的强大求解景一轻松模拟成百上千的粒子能使用参数扫描磁透镜可指定粒子的边界条件解储存于模型而非在后处理射计算隐式时间步进支持粒子/场相互作用预定义力作为模型中可用在C.CO四极质谱仪Hamilton算子允许模拟光线追踪新的后处理工具仿真智领创新Simulating inspires innovationInTech光学隐身com仿真智领创新Simulating inspires innovationInTechameland透镜仿真智领创新Simulating inspires innovationInTech模块理论基础RF Radio Frequency(Electromagnetic Waves)3kHz-300GHz高频电磁波电尺寸=结构尺寸/波长>1/100基于经典 Maxwell d磁理论。A+Y×xA)=0时域分析OAot ratVx(u-VXE)-oEE=0频域分析X(EVxHH=0仿真智领创新Simulating inspires innovationInTech电磁波领域研宽課题电磁波的产生各种波源的辐射机制电磁波的传播听射/千涉WdoC反射/折射/散射/吸收光电/热/力效应仿真智领创新Simulating inspires innovationInTech数值分析散射分析散射强度透射/反射率波导分析一模式:坜分布,传播常数透射/反射率腔模分析共振频率品质因子噼态传播/非线性效应docin. col一群速度(色散)倍频产生、自聚焦、自相位调制等多场耦合光与热,电,磁,力特性的耦合仿真智领创新Simulating inspires innovationInTech纳米光子学仿真需求纳米材料/结构的光学特性光纤/波导波导分析纳米光子学器件激光器纳米光子学隐形斗篷稳态传输特性分析光刻纳米结构的光镊/先光势阱光学制备、表征方法分子探测瞬态/非线性效应分析仿真智领创新Simulating inspires innovation
- 2020-07-01下载
- 积分:1
-
基于单片机的温室大棚温湿度亮度自动控制系统
基于AT89S52的大棚温湿度亮度自动控制系统,温度传感器DS18B20,湿度传感器HS1101,亮度传感器是光敏电阻。
- 2020-12-11下载
- 积分:1
-
Building Trading Bots Using Java [2016]
Building Trading Bots Using JavaEnglish | 6 Jan. 2017 | ISBN: 1484225198 | 300 Pages | PDF | 6.22 MBBuild an automated currency trading bot from scratch with java. In this book, you will learn about the nitty-gritty of automated trading and have a closer look at Java, the Spring Framework, event-Building Trading Bots Using Javahekhar VarshneyGrangesSwitzerlandISBN13(pbk):978-1-4842-2519-6ISBN-13(electronic): 978-1-4842-2520-2DOI10.1007/978-1-4842-2520-2Library of Congress Control Number: 2016961228Copyright o 2016 by Shekhar VarshneyThis work is subject to copyright All rights are reserved by the Publisher, whether the wholeor part of the material is concerned, specifically the rights of translation, reprinting, reuse ofillustrations, recitation, broadcasting, reproduction on microfilms or in any other physicalway, and transmission or information storage and retrieval, electronic adaptation, computersoftware, or by similar or dissimilar methodology now known or hereafter developedTrademarked names, logos, and images may appear in this book. Rather than use a trademarksymbol with every occurrence of a trademarked name, logo, or image we use the names, logos,nd images only in an editorial fashion and to the benefit of the trademark owner, with nointention of infringement of the trademarkThe use in this publication of trade names, trademarks, service marks, and similar terms, even ifthey are not identified as such, is not to be taken as an expression of opinion as to whetheror notthey are subject to proprietary rightsWhile the advice and information in this book are believed to be true and accurate at thedate of publication, neither the authors nor the editors nor the publisher can accept any legalresponsibility for any errors or omissions that may be made. The publisher makes no warranty,express or implied, with respect to the material contained hereinManaging Director: Welmoed SpahrLead Editor: Steve AnglinEditorial Board: Steve Anglin, Pramila Balan, Laura Berendson, Aaron Black, Louise Corrigan,Jonathan gennick, Robert Hutchinson, Celestin Suresh John, Nikhil KarkalJames Markham, Susan McDermott, Matthew Moodie, Natalie Pao, Gwenan SpearingCoordinating Editor: Mark PowersCopy Editor: Kezia EndsleyCompositor: SPi GlobalIndexer: SPi GlobaArtist: SPi GlobalDistributed to the book trade worldwide by Springer Science+ Business Media New York,233 Spring Street, 6th Floor, New York, NY 10013. Phone 1-800-SPRINGER, fax(201)348-4505e-mailorders-ny@springer-sbm.comorvisitwww.springeronline.com.ApressMedia,Llcisa California LlC and the sole member(owner) is Springer Science Business Media FinanceInc(SSBM Finance Inc). SSBM Finance Inc is a Delaware corporationForinformationontranslationspleasee-mailrights@apress.comorvisitwww.apress.comApress and friends of ed books may be purchased in bulk for academic, corporate, or promotionaluse eBook versions and licenses are also available for most titles For more information referenceourSpecialbUlkSales-ebookLicensingwebpageatwww.apress.com/bulk-salesAny source code or other supplementary materials referenced by the author in this text areavailabletoreadersatwww.apress.com.Fordetailedinformationabouthowtolocateyourbookssourcecodegotowww.apress.com/source-code/.ReaderscanalsoaccesssourcecodeatSpringerlink in the Supplementary Material section for each chapter.Printed on acid-free paperedicated to the angels in my lifemy mother, my wife Preshita, and my two daughters Mihika and anyaLast but not the least, my college professor, Dr. Rajat Moona,who sowed the seeds of computer programming in my dnaContents at a glanceAbout the authorChapter 1: Introduction to Trading Bota.Chapter 2: Account Management27Chapter 3: Tradeable Instruments47Chapter 4: Event Streaming: Market Data EventsChapter 5: Historic Instrument Market Data aeEERaar75Chapter 6: Placing Orders and trades97Chapter 7: Event Streaming: Trade/Order/Account Events159Chapter 8: Integration with Twitter aamna■■■■■■■■■■■■■■■■■■■■■■■■■■■■■■■■■■■■■175Chapter 9: Implementing Strategies.am.203Chapter 10: Heartbeating ammmmmmmmmmmn 219Chapter 11: E-Mail Notifications ammmmatmmammmmmmmnmamman 231Chapter 12: Configuration, Deployment, and Running the Bot 243Chapter 13: Unit Testing■■■■■■■■■■■■口■■■■■■■■■■■■■■■■■■■口■■■■■■■■■■■■■■■■■■口■■■■■263Index…277ContentsAbout the author,i币Chapter 1: Introduction to Trading Bot m mmmemmIRD■■■■■■■■■■■■■■■■■■■■■■■■■What Is a Trading Bot?Why do We need a trading bot?...3The capabilities of the Trading BotDesign goalsCode organization and software Stack Used .OANDA REST API as Reference Implementation.m....ammann. 8Opening an oanda practice Account80 ANDA JS0 N Keys…………Constructor Dependencies for OANDA Implementations15Event-Driven architectureG0 ogle eventBus…18Provider helper Interface20Trading Config class.........mmonann......mtnonnn.......tnn 22Obtaining the Source Code.aaeeaaaee... 24Try It Yourself section..aaaaaa.. 24Chapter 2: Account Managementa27Account provider interface31A Concrete Implementation for AccountDataProvider32Encapsulating Everything Behind a Generic AccountlnfoService37Try It yourself43VIlCONTENTSChapter 3: Tradeable Instruments47InstrumentA Concrete Implementation for InstrumentDataProvider52Encapsulating Everything Behind a Generic Instrumentservice56Try It yourself58Chapter 4: Event Streaming: Market Data Events mmmmmmmmmm. 61Streaming Market Data Interface.A Concrete Implementation for MarketData StreamingService .m..63Downstream Market data event disseminationMarketEventcallback……69Try It Yourself,…70Chapter 5: Historic Instrument Market Data mmmmmmmm 75How to read a candlestick75Enum Defining the Candlestick Granularity76Define pojo to hold candlestick information77Historical Data Provider Interface79A Concrete Implementation for HistoricMarketDataProvidern81Discussion An Alternate Database Implementation85Candlesticks for Moving Average Calculations....88MovingAverage calculation Service89Try lt YourselfChapter 6: Placing Orders and Trades■■■■■■■■■■■■■■■■■■■■■■■■■■■■■■■■■■■■■■■■97Order pojo definition98Order Management provider Interface101A Concrete Implementation for Order ManagementProvider,103A Simple orderInfoService,115CONTENTSValidating Orders Before Execution: PreOrderValidationService... 116Putting It All Together in an OrderExecution Service .mmmm... 121Trade pojo definition124Trade Management provider Interface127A Concrete Implementation for TradeManagementProvider129Encapsulating Read Operations Behind TradelnfoService.....m. 136Try It yourself144Chapter 7: Event Streaming: Trade/order/Account Events m 159Streaming Event Interface161A Concrete Implementation for Events StreamingService162Try It Yourself171Chapter 8: Integration with Twitter■■■■■■■■■■■■■■■■■■■■175Creating a Twitter Application175Spring Social180Using and Configuring Spring Social180Harvesting FX Tweets181Tweetharvester Interface wmmm. 185XTWeethandler Interface,,,………AbstractFxtweethandler base class186User-Specific TweetHandlersTry lt Yourself.Chapter 9: Implementing Strategies.aa203Copy Twitter Strategy204Fade the Move Strategy210Try It Yourself214CONTENTSChapter 10: Heartbeating ammammmmmmmmmmmmmmm 219HeartBeatPayload. ..m......m. 219Streaming the Heartbeat Interface220A Concrete Implementation for HeartBeatstreamingService221HeartBeatcallback Interface223DefaultheartBeatservice223Try It Yourself226Chapter 11: E-Mail notifications n231Notification Design.EmailPayLoad poJoEmailContentgenerator interface……232Sample Implementations.EventEmailNotifier service mm...m. 235Try It Yourself.237Chapter 12: Configuration, Deployment, and running the bot m 243Configuring the Trading Bot243Core Beans configuration244Twitter-Related Beans Configuration.....................247Provider Beans Configuration248Strategies configuration…254Services Configuration254Building the Bot...,,,,,…,,……256Running the bot.....,,……259CONTENTSChapter 13: Unit Testinga263Using Mockito as a Mocking Framework.Mocking Http iNteraction..............m....................e........................ 264Mocking Streams.The versatile verify Mockit0…....,.,,…271Mocking Twitter Interaction .EclEmma Code Coverage Tool for Eclipse ide.nDDDDDDDDDm274Index■■■■■■■■■■■■■■■■■■■口En277
- 2020-12-07下载
- 积分:1
-
fastica的matlab实现
本代码用matlab进行编程,可以实现fastica算法,非常简单易懂
- 2020-12-09下载
- 积分:1