<?xml version="1.0" encoding="UTF-8"?><rss xmlns:dc="http://purl.org/dc/elements/1.1/" xmlns:content="http://purl.org/rss/1.0/modules/content/" xmlns:atom="http://www.w3.org/2005/Atom" version="2.0" xmlns:cc="http://cyber.law.harvard.edu/rss/creativeCommonsRssModule.html">
    <channel>
        <title><![CDATA[Stories by Hareem Rashid on Medium]]></title>
        <description><![CDATA[Stories by Hareem Rashid on Medium]]></description>
        <link>https://medium.com/@hareemrashid?source=rss-bb27004a9b9------2</link>
        <image>
            <url>https://cdn-images-1.medium.com/fit/c/150/150/1*YPTrUgbhetUnsS9i-i94kg.jpeg</url>
            <title>Stories by Hareem Rashid on Medium</title>
            <link>https://medium.com/@hareemrashid?source=rss-bb27004a9b9------2</link>
        </image>
        <generator>Medium</generator>
        <lastBuildDate>Mon, 30 Nov 2026 01:24:20 GMT</lastBuildDate>
        <atom:link href="https://medium.com/@hareemrashid/feed" rel="self" type="application/rss+xml"/>
        <webMaster><![CDATA[yourfriends@medium.com]]></webMaster>
        <atom:link href="http://medium.superfeedr.com/" rel="hub"/>
        <item>
            <title><![CDATA[How to design your SPI communication protocol using Verilog?]]></title>
            <link>https://medium.com/@hareemrashid/how-to-design-your-spi-communication-protocol-using-verilog-5448b67a327b?source=rss-bb27004a9b9------2</link>
            <guid isPermaLink="false">https://medium.com/p/5448b67a327b</guid>
            <category><![CDATA[ic-design]]></category>
            <category><![CDATA[verilog]]></category>
            <category><![CDATA[cadence]]></category>
            <category><![CDATA[spi]]></category>
            <category><![CDATA[simulation]]></category>
            <dc:creator><![CDATA[Hareem Rashid]]></dc:creator>
            <pubDate>Mon, 23 May 2022 15:24:42 GMT</pubDate>
            <atom:updated>2022-05-23T15:24:42.089Z</atom:updated>
            <content:encoded><![CDATA[<h4>Part 2a</h4><p><strong>Introduction:</strong></p><p>Welcome back to installment two of our series on how to implement SPI communication protocol on ASIC. Now before we dive in, you must have some basic working knowledge about Boolean operators and algebra, how sequential and combinational logic circuits work, basic logic gates, and so on.</p><p>The first step towards designing your chip is making sure you understand exactly what it is you want your ASIC to do. Now it can be anywhere from wanting a tiny chip that can act as a tracker or even your own cool device that throws spider webs (Everyone loves Spiderman). What I did was a bit more boring than spider webs but still fun, it was a chip that implements SPI communication protocol, to help communicate between electronic devices. So, let’s get started!</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*6uOfWRR5nOKXEcnTxrKDoQ.jpeg" /><figcaption>Circuit Board</figcaption></figure><p><strong>What is Verilog coding?</strong></p><p>ASIC design is divided into two major parts, Front-End design, and Back-End Design. Now the first step is learning how to do Front-End design before moving on to Back-End, which quite frankly is more fun than coding. The first step is to implement our protocol by using Verilog to obtain our RTL code (Register Transistor Level). We use Verilog to describe a digital system using digital hardware components such as a Flip-flop, microprocessor, or switch.</p><p>If you are a beginner who has never used Verilog before, the first step is to download software on which you can program your code and test its functionality. I used Xilinx Vivado to program my SPI protocol. Vivado allows you to test the functionality of your circuit to ensure it is working properly. For beginners, I would recommend Xilinx ISE Design Suite since it automatically generates a testbench for you and is great when you’re learning to write basic codes on Verilog.</p><p>For beginners out there you can start learning Verilog from sites such as Udemy and Coursera which offer some great free courses for beginners. I do have to warn you that if you think you can avoid coding during this entire process, you would be very wrong but instead of trying to code and map out something difficult like SPI, you could use this series to code and map out something easy like a two input Mux or a simple 4-bit adder circuit. Learning Verilog coding was certainly not an easy journey. Still, I managed to do it and learned how to navigate the software by utilizing the array of tools at my disposal provided by the Integrated Circuit Design Lab at FAST NUCES university. This lab is headed by my mentors Dr. Hassan Saif and Dr. Rashad Ramzan who helped me immensely during this journey and reignited my interest in electrical engineering by allowing me to be an active learner in the Integrated Circuit Design Lab and constantly motivating and pushing me along the way. It was under their umbrella that I was allowed to learn and build on my skills. Writing and implementing the code for the SPI communication protocol was an intensive process and I am immensely grateful for the guidance and help of my peers and teachers, especially Engr. Shaukat Ali, Engr. Ali Sabir and Engr. Hamza Atiq.</p><p><strong>SPI Protocol Verilog Code:</strong></p><p>Now for any programming nerd out there here comes the fun part, coding your communication protocol. What exactly is happening? The master device is responsible for transmitting three signals to your slave. This is the MOSI, SS, and SCLK signal whereas the slave receives these three signals as input and transmits the MISO signal as an output to the master.</p><p>It is important to understand that it is the master device that is controlling the communication and selects which slave it wishes to communicate with. The slave device can only communicate with the master device and no other slave devices whereas the master device can communicate with any slave on the bus. Since the master controls the clock signal and the slave select, the slave has no way of sending data to the master on its own. This means only the master decides when the slave gets to communicate, which is cool when you think about it (I kind of wish it worked like that with humans too).</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/0*tO2NUKB-ZV9zhUyz" /><figcaption>Photo by <a href="https://unsplash.com/@ptrikutam?utm_source=medium&amp;utm_medium=referral">Pavan Trikutam</a> on <a href="https://unsplash.com/?utm_source=medium&amp;utm_medium=referral">Unsplash</a></figcaption></figure><p>Now comes the gist of it, SPI works by transferring data based on the clock frequency. The clock polarity and the clock phase are two of the most vital components in determining data transfer. Master generates and sets the clock frequency for data transfer. The clock polarity helps determine the state of the clock itself. The Clock Phase (CPHA) is responsible for determining when the data will be transferred, and whether it will be transferred on the rising edge of the clock or the falling edge of the clock. Similarly, it also determines on which edge the data will be shifted out.</p><p>Based on the clock polarity and the clock phase, the SPI communication protocol has four modes of operation.</p><figure><img alt="SPI modes" src="https://cdn-images-1.medium.com/max/471/1*ObjikYe15JWxEE2M6auSPw.png" /><figcaption><strong>Clock Phase and Polarity to determine Data sampling and shifting</strong></figcaption></figure><figure><img alt="" src="https://cdn-images-1.medium.com/max/478/1*pH2d_kLfBIDZEfjxWGKCuw.png" /><figcaption><strong>Clock Phase and Polarity to determine Data sampling and shifting</strong></figcaption></figure><p><strong>Modes explained:</strong></p><p><strong>CPOL=0: </strong>Idle state of the clock is 0 and the active state is 1.</p><p><strong>CPOL=1: </strong>Idle state of the clock is 1 and the active state is 0.</p><p><strong>CPHA=0: </strong>In this mode, the data is sampled on the rising edge of the clock.</p><p><strong>CPHA=1: </strong>In this mode, the data is sampled on the falling edge of the clock cycle.</p><p>Since the SPI slave works on a simple principle of using a shift register to shift data out to the master, it is easy to implement and code. The major obstacle is writing your code for the SPI master which is why I have shared a flowchart below to guide you in creating your SPI master module. You can even take help from Github and other online platforms to understand how to implement your code!</p><p>Now, this is getting a bit long, so I divided this article into two parts. I hope you learned a lot from this tutorial. Stay tuned for the next one!</p><img src="https://medium.com/_/stat?event=post.clientViewed&referrerSource=full_rss&postId=5448b67a327b" width="1" height="1" alt="">]]></content:encoded>
        </item>
        <item>
            <title><![CDATA[How to implement SPI protocol on ASIC]]></title>
            <link>https://medium.com/@hareemrashid/how-to-implement-spi-protocol-on-asic-b39b5069702d?source=rss-bb27004a9b9------2</link>
            <guid isPermaLink="false">https://medium.com/p/b39b5069702d</guid>
            <category><![CDATA[ic-chip]]></category>
            <category><![CDATA[asics]]></category>
            <category><![CDATA[integrated-circuit-design]]></category>
            <category><![CDATA[chips]]></category>
            <category><![CDATA[spi]]></category>
            <dc:creator><![CDATA[Hareem Rashid]]></dc:creator>
            <pubDate>Mon, 09 May 2022 17:16:28 GMT</pubDate>
            <atom:updated>2022-05-09T17:16:28.063Z</atom:updated>
            <content:encoded><![CDATA[<h4><strong><em>Part 1</em></strong></h4><h3><strong>Introduction:</strong></h3><p>There are a lot of scary words in the title, but it’s not as terrifying as you think. If you’re an electrical engineer like me, you have probably heard of SPI (Serial Peripheral Interface) communication protocol at least once in your life unless you have been living under a rock, but chances are this is the first time you are hearing about ASIC (Application Specific Integrated Circuit) and have yet to make the connection between SPI and ASIC.</p><p>The good news is there is no need to fear! This is going to be technical series that starts with an easy-to-understand introduction to the world of IC (Integrated Circuit) designing and communication protocols. We are going to be talking about one protocol in this series which is the SPI communication protocol, and our entire journey together is going to be based on this protocol. I am going to keep this series, easy to understand so that even as a beginner you can pick up the necessary skills needed to understand how to design your very own IC chip!</p><p>Here is a breakdown of what is to come for you to understand how to go about designing our own IC chip on 65nm CMOS technology.</p><ul><li>An Introduction to the world of IC designing, Communication protocols, and Application Specific Integrated Circuits.</li><li>How to design your SPI communication protocol using Verilog</li><li>How to implement your SPI code on FPGA for verification</li><li>How to map SPI communication protocol on 65 nm technology using Cadence Tool Suite</li></ul><p>In this article, I will be letting you take a peek into the world of IC designing, communication protocols, and ASIC chips.</p><figure><img alt="A Semiconductor chip wih componens and inerconncions" src="https://cdn-images-1.medium.com/max/1024/1*k-Xx3fRUuNP-UDiQWY8uwg.jpeg" /><figcaption>Semiconductor Chip</figcaption></figure><h3>What is an Integrated Circuit?</h3><p>Now I have been using the word IC chip a lot, but exactly what does it mean? You are probably reading this article on your phone or laptop or any other electronic device. And while you might think you aren’t familiar with an IC chip, the dozens of IC chips making every electronic device around you work probably beg to differ. So, by now you have realized that you are more acquainted with an IC chip than you probably thought! But what exactly is it?</p><p>Integrated circuits are an essential part of electronic devices these days. Today’s ICs consist of billions of transistors existing on a piece of the silicon semiconductor substrate. The integration of electrical components and their interconnections on a small wafer of silicon results in an IC chip that can perform a variety of functions from taking a picture on your phone to sending a message to a loved one. These electrical components include a wide variety of active and passive devices such as transistors, diodes, capacitors, and resistors. One of the most basic building blocks of your IC chip is the transistor.</p><p>The critical dimensions of today’s IC chips are in the order of 10 nanometers where the smallest fabricated IC chip that exists has a size of<strong> two nanometers </strong>and consists of <strong>50 billion transistors</strong>.</p><p>The IC chip being used in your phone right now is made up of billions of transistors, but what exactly is the purpose of a transistor? A transistor is a semiconductor device that is responsible for amplifying, controlling, and generating electrical signals. It was this simple device that helped Jack Kilby create the<strong> first IC chip in 1958</strong>.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*0JF42bkp40MixYrzgBDOtw.jpeg" /><figcaption>MOSFET Transistor</figcaption></figure><p>An integrated circuit can be of different types, it can be an analog circuit (A circuit that gives a constantly varying signal as output), a digital circuit (electronic circuits which can operate in only two states, true or false, which corresponds to a binary value of zero or one), or even a microprocessor circuit (thousands of transistors making up individual digital circuits each of which performs a specific function). ­­­­­</p><p>IC chips are commonly used in electronic devices because they are small, so they reduce the size of the electronic device as well. They also have a lower power consumption rate and are more reliable. They also possess a higher processing speed as compared to the transistors that existed in electronic devices before them. The recent developments in technology allow electronic devices fitted with IC chips to respond to a wider range of inputs and give a wide range of outputs as well.</p><p>IC chips are relatively cheaper to produce which has allowed them to become such a popular component of electronic devices. The absence of IC chips in electronic devices would mean that these devices are much slower and bulkier than seen in the industry today.</p><h3>Now that we know what an IC is, what exactly is an Application Specific Integrated Circuit?</h3><p>An application-specific integrated circuit (ASIC) is an integrated circuit developed specifically by engineers to perform a specific function or satisfy the requirements of a particular application. ASIC chips are developed specifically to allow customized usage rather than being used for general purpose applications.</p><p>When compared to integrated circuits, an ASIC can give faster speed, better signal integrity, and lower power consumption since it is being designed for a specific use and its parameters can be customized according to the needs of the application. ASIC chips are more expensive to design and manufacture since there is a limited usage requirement for them, and only a few units are required to be manufactured.</p><p>ASIC chip design and manufacturing can be made cheaper and easier by designing structured ASICs. A structured ASIC consists of predefined parameters such as a predefined floor plan, die size, placement, and clocking parameters (No need to worry if you can’t understand these terms, I will be explaining them later on in the series).</p><p>Structured ASICs also consist of a predefined power grid and predefined power consumption parameters. Designing and manufacturing structured ASICs carries a lower risk with it than designing a full-blown ASIC, since the parameters are already known, and designers know that the device will work before wafer manufacturing. It is also a cheaper process to design a structured ASIC since the power grid and clock tree distribution issues have been addressed by the vendor.</p><figure><img alt="An Inegraed Circui Chip" src="https://cdn-images-1.medium.com/max/1024/1*j8WGggNeZi-5-m5WsnEYBA.jpeg" /><figcaption>Integrated Circuit Chip</figcaption></figure><h3>What is SPI Communication Protocol?</h3><p>Now finally we are going to be talking about the star of the show, the SPI communication protocol. SPI stands for Serial Peripheral Interfaces, originally designed by Motorola in 1979. SPI it’s a very commonly used communication protocol which is the abbreviated form of synchronous serial communication interface. SPI is used in instances where data must be transmitted over a short-range. SPI operates at Full Duplex, which means that it has two different lines for input and output. As a result, data can be received and transmitted at the same time.</p><p>SPI supports a single master multi-slave configuration. SPI is also known as a four-wired interface, including SCLK, MOSI, MISO, and SS.</p><figure><img alt="A block diagram showcasing how SPI protocol works" src="https://cdn-images-1.medium.com/max/566/1*J3ThnOtz1hx-KFuXMu6KNA.png" /><figcaption>SPI Communication Protocol</figcaption></figure><p>It operates in Master-Slave architecture in which the device initializing the clock (SCLK) becomes the master. The Master out Slave (MOSI) is the data line that is responsible for transmitting data from the master to the slave. Similarly, there is another data line, the Master in Slave out (MISO), responsible for transmitting data from the slave to the master. The fourth line of the SPI bus which allows the master to select a slave is the SS (Slave Select) which as its name suggests is a signal line transmitted from the master and determines which slave is to be selected to transmit the data to. This signal line commonly operates on an active low and it’s turned high when the master needs to disconnect from the slave and stop the transmission of data to the slave from the SPI bus.</p><p>Now how does all of this help us in creating<em> </em>our own chip? Stay tuned for part 2!</p><img src="https://medium.com/_/stat?event=post.clientViewed&referrerSource=full_rss&postId=b39b5069702d" width="1" height="1" alt="">]]></content:encoded>
        </item>
    </channel>
</rss>