<?xml version="1.0" encoding="UTF-8"?><rss version="2.0"
	xmlns:content="http://purl.org/rss/1.0/modules/content/"
	xmlns:wfw="http://wellformedweb.org/CommentAPI/"
	xmlns:dc="http://purl.org/dc/elements/1.1/"
	xmlns:atom="http://www.w3.org/2005/Atom"
	xmlns:sy="http://purl.org/rss/1.0/modules/syndication/"
	xmlns:slash="http://purl.org/rss/1.0/modules/slash/"
	>

<channel>
	<title>Simulation &#8211; Daniel Biller&#039;s Portfolio</title>
	<atom:link href="/portfolio-category/simulation/feed/" rel="self" type="application/rss+xml" />
	<link>/</link>
	<description></description>
	<lastBuildDate>Tue, 21 Mar 2023 00:40:33 +0000</lastBuildDate>
	<language>en-US</language>
	<sy:updatePeriod>
	hourly	</sy:updatePeriod>
	<sy:updateFrequency>
	1	</sy:updateFrequency>
	<generator>https://wordpress.org/?v=6.1.1</generator>

<image>
	<url>/wp-content/uploads/2023/03/cropped-db-favacon-3-32x32.png</url>
	<title>Simulation &#8211; Daniel Biller&#039;s Portfolio</title>
	<link>/</link>
	<width>32</width>
	<height>32</height>
</image> 
	<item>
		<title>Particle Simulation – Computational Biomechanics Research</title>
		<link>/projects/particle-simulation/</link>
		
		<dc:creator><![CDATA[dbiller]]></dc:creator>
		<pubDate>Tue, 14 Mar 2023 23:05:53 +0000</pubDate>
				<guid isPermaLink="false">/?post_type=rara-portfolio#038;p=660</guid>

					<description><![CDATA[This project is part of a team effort to study colloids movement on 2D manifolds, the formation of lattice defects, and how they relate to the morphing of viral capsids. ]]></description>
										<content:encoded><![CDATA[
<h2>Summary</h2>



<ul>
<li><strong>What Is It?</strong> &#8211; Simulated Annealing program for studying crystal defect formation on 2D manifolds</li>



<li><strong>Technologies Used</strong> &#8211; Julia</li>



<li><strong>My Accomplishments</strong>
<ul>
<li>Improved algorithm speed by 40x</li>



<li>Drove project to completion</li>



<li>Effectively communicated technical requirements with a non-technical stakeholder</li>
</ul>
</li>
</ul>



<div class="wp-block-media-text alignwide is-stacked-on-mobile" style="grid-template-columns:53% auto"><figure class="wp-block-media-text__media"><img decoding="async" width="499" height="519" src="/wp-content/uploads/2023/02/ezgif.com-gif-maker-3-3.gif" alt="" class="wp-image-587 size-full"/></figure><div class="wp-block-media-text__content">
<p>This project is part of a team effort to study colloids movement on 2D manifolds, the formation of lattice defects, and how they relate to the morphing of viral capsids. The team was led by Dr. Luigi Perotti at the University of Central Florida.</p>
</div></div>



<h2>What it Does</h2>



<div class="wp-block-media-text alignwide is-stacked-on-mobile" style="grid-template-columns:56% auto"><figure class="wp-block-media-text__media"><img decoding="async" width="600" height="400" src="/wp-content/uploads/2023/02/EnergyGraph-1.png" alt="" class="wp-image-579 size-full" srcset="/wp-content/uploads/2023/02/EnergyGraph-1.png 600w, /wp-content/uploads/2023/02/EnergyGraph-1-300x200.png 300w, /wp-content/uploads/2023/02/EnergyGraph-1-90x60.png 90w" sizes="(max-width: 600px) 100vw, 600px" /></figure><div class="wp-block-media-text__content">
<p>This program simulates particle interaction using a modified version of the Kinetic Monte Carlo Algorithm. After taking in a number of parameters including the number of particles, the number of iterations, and the equilibrium distance, the program initializes a set of randomly positioned particles.</p>
</div></div>



<p>During each timestep, each particle is perturbed and this move is either saved or reverted based on whether it lowers the total system energy. Eventually, the lowest possible energy configuration is reached.</p>



<div class="is-layout-flex wp-container-3 wp-block-columns">
<div class="is-layout-flow wp-block-column">
<figure class="wp-block-image size-full"><img decoding="async" width="700" height="519" src="/wp-content/uploads/2023/02/1-1.png" alt="" class="wp-image-565" srcset="/wp-content/uploads/2023/02/1-1.png 700w, /wp-content/uploads/2023/02/1-1-300x222.png 300w, /wp-content/uploads/2023/02/1-1-81x60.png 81w" sizes="(max-width: 700px) 100vw, 700px" /></figure>
</div>



<div class="is-layout-flow wp-block-column">
<figure class="wp-block-image size-full"><img decoding="async" width="700" height="519" src="/wp-content/uploads/2023/02/1250-1.png" alt="" class="wp-image-567" srcset="/wp-content/uploads/2023/02/1250-1.png 700w, /wp-content/uploads/2023/02/1250-1-300x222.png 300w, /wp-content/uploads/2023/02/1250-1-81x60.png 81w" sizes="(max-width: 700px) 100vw, 700px" /></figure>
</div>
</div>



<h2>How I Did It</h2>



<div class="wp-block-media-text alignwide has-media-on-the-right is-stacked-on-mobile"><div class="wp-block-media-text__content">
<p>I started with the pseudo-code for the modified Kinetic Monte Carlo algorithm. Using the Julia programing language, I implemented the algorithm along with supporting features such as estimated completion time, outputting an energy-time graph, and creating a particle movement animation. This iteration was extremely slow, but it worked.</p>
</div><figure class="wp-block-media-text__media"><img decoding="async" width="1024" height="941" src="/wp-content/uploads/2023/02/Sudocode-1024x941-2.png" alt="" class="wp-image-604 size-full" srcset="/wp-content/uploads/2023/02/Sudocode-1024x941-2.png 1024w, /wp-content/uploads/2023/02/Sudocode-1024x941-2-300x276.png 300w, /wp-content/uploads/2023/02/Sudocode-1024x941-2-768x706.png 768w, /wp-content/uploads/2023/02/Sudocode-1024x941-2-65x60.png 65w" sizes="(max-width: 1024px) 100vw, 1024px" /></figure></div>



<h2>Improvements I Made</h2>



<p>I was able to&nbsp;<strong>double the speed of my program</strong>&nbsp;simply by reducing repeated computations. For example, if I calculate the distance between particle&nbsp;<em>a</em>&nbsp;and particle&nbsp;<em>b</em>, then I don’t need to compare the distance again between&nbsp;<em>b</em>&nbsp;and&nbsp;<em>a</em>. I was also able to utilize parallelization, as each particle movement is independent.</p>



<p>From here I completely restructured the entire program to&nbsp;<strong>improve the energy calculation time complexity from O(n<sup>2</sup>) to O(n).</strong>&nbsp;This was a huge improvement because it increase the maximum number of particles from around 30 to a couple thousand. I did this by spatially encoding the position of each particles in memory.&nbsp;<em></em>I broke the region up into zones and each zone was an independent particle array. Each particle only needs to check it’s own zone, and the eight adjacent zones. Because zones scale with equilibrium distance, each particle only needs to compare to a small constant number of other particles.</p>


<div class="wp-block-image">
<figure class="aligncenter size-full is-resized"><img decoding="async" src="/wp-content/uploads/2023/02/particle-search-1-1024x887-2.png" alt="" class="wp-image-599" width="-85" height="-73" srcset="/wp-content/uploads/2023/02/particle-search-1-1024x887-2.png 1024w, /wp-content/uploads/2023/02/particle-search-1-1024x887-2-300x260.png 300w, /wp-content/uploads/2023/02/particle-search-1-1024x887-2-768x665.png 768w, /wp-content/uploads/2023/02/particle-search-1-1024x887-2-69x60.png 69w" sizes="(max-width: 1024px) 100vw, 1024px" /></figure></div>


<p>Overall, the improvements I made were able to&nbsp;<strong>speed up the original program by over 40 times.</strong></p>



<h2>What I Learned</h2>



<div class="wp-block-media-text alignwide has-media-on-the-right is-stacked-on-mobile"><div class="wp-block-media-text__content">
<p>This was the most challenging project I have ever completed and I learned so much during the process. First, I had never worked with this programming language before, but now I would consider myself&nbsp;<strong>proficient in Julia.</strong>&nbsp;Another thing I learned was&nbsp;<strong>how to obtain technical requirements from a non-technical person.&nbsp;</strong>I was given the task to “implement this algorithm” and had to figure everything out on my own. This taught me how to ask questions and learn what the goal of the project was, as well as determine what features would contribute to the goal. In implementing parallelism and my spatial encoding scheme,&nbsp;<strong>I learned a lot about memory management and working with shared memory.</strong>&nbsp;The final big lesson was learning&nbsp;<strong>how to develop software as a piece of a bigger project.</strong>&nbsp;My program need to accept inputs from a completely separate program and then map outputs in a way the next program would understand. Communicating with my team and being able to work together to line everything up was definitely challenging, but I developed a deeper understanding of team dynamics in the process.</p>
</div><figure class="wp-block-media-text__media"><img decoding="async" width="500" height="866" src="/wp-content/uploads/2023/02/ezgif.com-gif-maker-2-3.gif" alt="" class="wp-image-586 size-full"/></figure></div>
]]></content:encoded>
					
		
		
			</item>
		<item>
		<title>Autonomous Payload Delivery Drone</title>
		<link>/projects/delivery-drone/</link>
		
		<dc:creator><![CDATA[dbiller]]></dc:creator>
		<pubDate>Mon, 13 Mar 2023 18:26:56 +0000</pubDate>
				<guid isPermaLink="false">/?post_type=rara-portfolio#038;p=726</guid>

					<description><![CDATA[Summary Background Last mile deliveries (from warehouse to mailbox) are the most expensive part of delivery for businesses like Amazon. They also takes the greatest toll on society &#8211; using fossil fuels to power trucks, creating traffic in already congested areas, and filling landfills with the extra packaging needed to protect the goods during transit. &#8230; ]]></description>
										<content:encoded><![CDATA[
<h2>Summary</h2>



<ul>
<li><strong>What Is It?</strong>&nbsp;– Autonomous Drone for last-mile package delivery</li>



<li><strong>Technologies Used</strong>&nbsp;– C++, Python, Raspberry Pi, PX4, Linux, ORBSlam 3.0</li>



<li><strong>My Accomplishments</strong>
<ul>
<li>Decreased system unit cost by 40%</li>



<li>Implemented many different software into a cohesive system</li>



<li>Gathered technical requirements and design specifications</li>



<li>Designed and actualized project from start to finish</li>
</ul>
</li>
</ul>



<h2>Background</h2>



<p>Last mile deliveries (from warehouse to mailbox) are the most expensive part of delivery for businesses like Amazon. They also takes the greatest toll on society &#8211; using fossil fuels to power trucks, creating traffic in already congested areas, and filling landfills with the extra packaging needed to protect the goods during transit. Drones like the one we created for our senior project are able to solve all of these problems, helping both the businesses and society as a whole.</p>



<h2>What It Does</h2>



<p>This multirotor drone uses computer vision, GPS, and other sensor data to autonomously transport packages from a warehouse to a delivery destination, safely drop the package off, and then return to the warehouse for the next delivery.</p>



<h2>How We Did It</h2>



<p>My team designed this drone from the ground up before ultimately building and testing it. The first step was to concretely lay out our requirements and design specifications. Our original goal was just to make a working delivery drone, but after researching the cost of parts, we decided to also strive to make the whole unit cheaper, as this would be a product with large volumes.</p>



<p>Researching for this project was by far the biggest and most in depth analysis I have ever done. Together, my team contributed over 1000 hours of research to this project. Because the project was so open ended, and there were so many good options to use in our drone, it took a lot of work to select the perfect components for our system.</p>



<p>At this point, drones, are so widespread and readily available, that our airframe was not the interesting part of the project. We did not do any special designing for this. We simply picked an airframe that would fit our needs, namely be able to carry a 0.5 pound package 10 miles round trip. We picked this number because a huge number of packages (over 2/3) are able under 0.5 lbs.</p>



<div class="wp-block-media-text alignwide is-stacked-on-mobile is-image-fill" style="grid-template-columns:40% auto"><figure class="wp-block-media-text__media" style="background-image:url(/wp-content/uploads/2023/03/Picture2.png);background-position:50% 50%"><img decoding="async" width="422" height="542" src="/wp-content/uploads/2023/03/Picture2.png" alt="" class="wp-image-804 size-full" srcset="/wp-content/uploads/2023/03/Picture2.png 422w, /wp-content/uploads/2023/03/Picture2-234x300.png 234w, /wp-content/uploads/2023/03/Picture2-47x60.png 47w" sizes="(max-width: 422px) 100vw, 422px" /></figure><div class="wp-block-media-text__content">
<p>At this point, drones, are so widespread and readily available, that our airframe was not the interesting part of the project. We did not do any special designing for this. We simply picked an airframe that would fit our needs, namely be able to carry a 0.5 pound package 10 miles round trip. We picked this number because a huge number of packages (over 2/3) are able under 0.5 lbs.</p>



<figure class="wp-block-image size-full"><img decoding="async" width="857" height="508" src="/wp-content/uploads/2023/03/Picture1.png" alt="" class="wp-image-808" srcset="/wp-content/uploads/2023/03/Picture1.png 857w, /wp-content/uploads/2023/03/Picture1-300x178.png 300w, /wp-content/uploads/2023/03/Picture1-768x455.png 768w, /wp-content/uploads/2023/03/Picture1-101x60.png 101w" sizes="(max-width: 857px) 100vw, 857px" /></figure>
</div></div>



<div style="height:1em" aria-hidden="true" class="wp-block-spacer"></div>



<p>The most interesting part of the project, and my specialty, was the computer vision. This is where I spent the majority of my time researching, testing and implementing. I decided that computer vision was a good idea for this project because lidar is so much more expensive. After much investigation, I concluded that SLAM (Simultaneous Localization and Mapping) would be the best computer vision algorithm for our purposes. This would allow us keep track of the drones position and orientation in space over large distances, as well as remember where it had been. It would also map obstacles in the environment to ensure that the drone does not collide or crash. For the project, we used ORB-SLAM 3.0. This is an open-source SLAM implementation that had the perfect balance of performance, features, and robustness. We ran this on a Raspberry Pi on top of a special real-time versions of Linux.</p>


<div class="wp-block-image">
<figure class="aligncenter"><img decoding="async" width="828" height="446" src="/wp-content/uploads/2023/03/Picture3.png" alt="" class="wp-image-806" srcset="/wp-content/uploads/2023/03/Picture3.png 828w, /wp-content/uploads/2023/03/Picture3-300x162.png 300w, /wp-content/uploads/2023/03/Picture3-768x414.png 768w, /wp-content/uploads/2023/03/Picture3-111x60.png 111w" sizes="(max-width: 828px) 100vw, 828px" /></figure></div>


<div style="height:1em" aria-hidden="true" class="wp-block-spacer"></div>



<p>Our flight control software was PX4, another open-source platform. It was relatively simple to set up and run on the Raspberry Pi. The challenging part was connecting it with our computer vision layer. When the camera detects an obstacle, how do we navigate around it? PX4 comes with a package that enables obstacle avoidance using a point-cloud. The problem is that it uses it&#8217;s own computer vision software and requires a stereo camera with depth sensors. These are very expensive, and we avoided them for the same reason as the lidar sensors. This meant that we had to modify the PX4 Obstacle Avoidance package to skip its own computer vision algorithm and instead take in the point-cloud from ORB-SLAM. This was very challenging and finnicky to get these programs to work together. We ultimately used ROS to communicate between them. This allowed us to finally do obstacle avoidance with a single camera.</p>


<div class="wp-block-image">
<figure class="aligncenter size-large is-resized"><img decoding="async" src="/wp-content/uploads/2023/03/Picture4-1024x758.png" alt="" class="wp-image-807" width="601" height="444" srcset="/wp-content/uploads/2023/03/Picture4-1024x758.png 1024w, /wp-content/uploads/2023/03/Picture4-300x222.png 300w, /wp-content/uploads/2023/03/Picture4-768x569.png 768w, /wp-content/uploads/2023/03/Picture4-81x60.png 81w, /wp-content/uploads/2023/03/Picture4.png 1064w" sizes="(max-width: 601px) 100vw, 601px" /></figure></div>


<div style="height:1em" aria-hidden="true" class="wp-block-spacer"></div>



<h2>What I Achieved</h2>



<p>The biggest accomplishment of the project was <strong>reducing the system cost by 40%</strong> through the use of computer vision rather than lidar or other expensive sensors. At the time of the project, the appropriate lidar sensors costed around $300. With the whole system costing around $700, this is a huge expense. Using a $10-$20 camera, we were able to reduce the unit cost by a huge amount, which helps to manufacture this product at a large scale and deploy it widely.</p>



<p>Another part of the project I&#8217;m proud of is being able to connect many different software into a complete system. Many parts of the project were trivial to set up on their own. The challenge came from integrating them together. I am proud of the fact that I was able to get each part working with all the others, especially the obstacle avoidance software that I had to modify.</p>



<h2>What I Learned</h2>



<p>This project was a very open ended research project that required lots of planning and problem solving to complete successfully. With this being very similar to my <a rel="noreferrer noopener" href="/projects/rtis-research/" target="_blank">Real Time Systems Security Research</a>, I strengthened and improved many of the skills I learned from that project, namely: <strong>developing concreate requirements,</strong> <strong>researching complex open ended topics to get results</strong>, and <strong>designing a complete software system.</strong></p>



<p>In addition to these skills, I also learned a lot from writing the research paper that went along with this senior project. It taught me how to <strong>clearly document technical details </strong>and <strong>effectively communicate ideas and impact in a way that non-technical stakeholders can understand.</strong></p>



<p>Lastly, I strengthened my ability to <strong>integrate separate programs into the whole.</strong> This is something which is very important in creating a finished product. While I did gain some practice doing this in my other research projects, the delivery drone gave me much more of this valuable experience.</p>



<p>Overall, this project has made me so much more <strong>confident with my general engineering ability,</strong> in addition to my programming skills.</p>
]]></content:encoded>
					
		
		
			</item>
		<item>
		<title>Real Time Systems Security Research</title>
		<link>/projects/rtis-research/</link>
		
		<dc:creator><![CDATA[dbiller]]></dc:creator>
		<pubDate>Sun, 12 Mar 2023 18:24:58 +0000</pubDate>
				<guid isPermaLink="false">/?post_type=rara-portfolio#038;p=725</guid>

					<description><![CDATA[Summary Motivation Historically, security has not been a priority in real-time systems, but this is not for lack of need. Real-time systems are becoming more common in safety-critical applications such as self driving cars. In these systems, malicious attacks can have serious, sometimes deadly, consequences. Implementing a security solution for real-time systems is not trivial, &#8230; ]]></description>
										<content:encoded><![CDATA[
<h2>Summary</h2>



<ul>
<li><strong>What Is It?</strong> – Testbench used to train AI to detect security threats in safety-critical real-time systems  </li>



<li><strong>Technologies Used</strong>&nbsp;– Java, FreeRTOS, MicroROS, Spike (RISCV-ISA-SIM), FPGA</li>



<li><strong>My Accomplishments</strong>
<ul>
<li>Developed concrete requirements by understanding motivation and goals</li>



<li>Designed and implemented RTOS resource monitor testbench in software</li>



<li>Successfully planned and transferred testbench from software to hardware, including physical coprocessor</li>
</ul>
</li>
</ul>



<h2>Motivation</h2>



<p>Historically, security has not been a priority in real-time systems, but this is not for lack of need. Real-time systems are becoming more common in safety-critical applications such as self driving cars. In these systems, malicious attacks can have serious, sometimes deadly, consequences. Implementing a security solution for real-time systems is not trivial, however. Embedded systems do not have extra compute power to devote to complex security programs like desktop computers do. A security solution that does not impact performance is desperately needed for these safety critical systems.</p>



<h2>Background</h2>



<ul>
<li>RTOS: A real-time operating system (RTOS) is an operating system for real-time computing applications that processes data and events which have critically defined time constraints.</li>



<li>Mixed-criticality system: A system in which some tasks are high-criticality (must be completed) and some are low-criticality (acceptable to not finish)</li>



<li>Mode-switch: When a low-criticality task overruns its deadline, the OS stops execution of low-criticality tasks and only executes high-criticality tasks. This is to ensure that the high-criticality tasks will finish by their deadline.</li>
</ul>



<p>This research project was based on the paper “Pythia-MCS: Enabling Quarter-Clairvoyance in I/O-Driven Mixed-Criticality Systems.” This paper uses a coprocessor to measure resource usage statistics and I/O volume. With this information, an AI is trained to predict task overruns and mode-switch before they occur. Doing this increases schedualability in the system.</p>



<h2>What It Does</h2>



<p>Our project extends this idea of overrun prediction by analyzing many different metrics such as resource usage and memory access patterns in real time. Using a coprocessor, our system detects and terminates security threats before they are able to cause damage.</p>



<h2>How I Did It</h2>



<p>My role in this project was to architect and implement the technology stack we would use. After laying the foundation, my professor and his graduate student would use my setup to test and develop the security coprocessor. I did my part in three phases.</p>



<p>First, I gathered requirements. This was relatively easy to do, because my team already had a good idea of the goals for the project. After a few discussions, we settled on our final requirements. I then used these to design an optimal system. My plan was to first create a proof-of-concept completely in software, as it is easier to iterate with. Once that was promising, we would then transfer it to the physical board.</p>



<p>Second, I created the software testbench. I used Spike, which is an open source, RISCV instruction set architecture simulator. It would simulate the physical instructions that our processor would run. On top of this simulator, I ran FreeRTOS. This is an open source real-time operating system. This is a very common OS used in embedded systems. Lastly, on top of FreeRTOS, I ran microROS, which is a a commonly used open source robotics library. This would allow us to run our test cases easier. We could run microROS operations and then analyze the resource usage. To simulate the coprocessor, I wrote a python program. The program would essentially be a driver for Spike. It would have Spike execute one instruction, then analyze the output. I had the program log things like register values, memory addresses, instruction types, and I/O volume. From here, my team could use my tool to gather and analyze any information they wanted.</p>



<p>Last, I set up the physical board. The hardware we decided on was the Xilinx Zynq-7000. This was perfect for our needs because it has an ARM CPU and FPGA in the same chip. Because they are on the same chip, the FPGA has access to the CPU’s hardware such as registers. The team would use the FPGA to create a coprocessor in hardware, while still being able to quickly iterate. All that was left was to install the software stack onto the board and then design the coprocessor. This is where I handed off my contribution to the others, and allowed them to get started on the analysis.</p>



<h2>What I Learned</h2>



<p>I learned to <strong>develop concreate requirements.</strong> Unlike school projects, the requirements were not handed to me. I had to understand the motivation and goals of the project, and come up with requirements that allowed us to achieve the goals. One thing that was important for me was to avoid thinking of implementation. This puts too many constraints on the project and can impede the goals. I learned that it is important to focus on the purpose of the project and leave implementation for later.</p>



<p>I learned <strong>how to research a complex, open ended topic to get results.</strong> There were many different directions I could have gone with this project, and I ran into many dead ends. It was discouraging but a valuable learning experience. I learned to do preliminary research on a wide area and slowly narrow the scope as I learned more about my options.</p>



<p>Lastly, I learned <strong>how to design a complete software system.</strong> Figuring out the overall architecture of a project, and how each piece will fit together, is much more challenging that writing a self contained program. I learned to consider how each piece fits together, which is something that came in handy with my <a href="/projects/delivery-drone/" target="_blank" rel="noreferrer noopener">Autonomous Delivery Drone</a> project.</p>



<p>Overall, this project taught me a lot about the design and planning that goes into a large complex project.</p>
]]></content:encoded>
					
		
		
			</item>
		<item>
		<title>Virtual Memory Simulator</title>
		<link>/projects/virtual-memory-simulator/</link>
		
		<dc:creator><![CDATA[dbiller]]></dc:creator>
		<pubDate>Thu, 23 Feb 2023 05:06:35 +0000</pubDate>
				<guid isPermaLink="false">/?post_type=rara-portfolio#038;p=705</guid>

					<description><![CDATA[The program simulates a series of memory accesses while keeping track of key performance statistics like hit rate and hard disk accesses.]]></description>
										<content:encoded><![CDATA[
<h2>Summary</h2>



<ul>
<li><strong>What Is It?</strong>&nbsp;– Program to analyze cache behavior based on memory access patterns</li>



<li><strong>Technologies Used</strong>&nbsp;– Java</li>



<li><strong>My Accomplishments</strong>
<ul>
<li>Gained understanding of physical memory and cache operation</li>



<li>Studied how access patterns impact hit-rate and access time</li>



<li>Applied Object Oriented Programming best practices</li>
</ul>
</li>
</ul>



<h2>What It Does</h2>



<div class="wp-block-media-text alignwide is-stacked-on-mobile"><figure class="wp-block-media-text__media"><img decoding="async" width="729" height="943" src="/wp-content/uploads/2023/02/desk-1-1.png" alt="" class="wp-image-578 size-full" srcset="/wp-content/uploads/2023/02/desk-1-1.png 729w, /wp-content/uploads/2023/02/desk-1-1-232x300.png 232w, /wp-content/uploads/2023/02/desk-1-1-46x60.png 46w" sizes="(max-width: 729px) 100vw, 729px" /></figure><div class="wp-block-media-text__content">
<p>The program simulates a series of memory accesses while keeping track of key performance statistics like hit rate and hard disk accesses. When a memory access is requested, the program first checks the page table to see if that address is in TLB. If there is a TLB miss, the program moves on to check the page table. If that address is still not found, that means that it must be on the hard disk. The program simulates reading the block from the hard disk and finds an open frame in the frame table to put the block. The simulation puts the entry into the page table and marks the corresponding frame as allocated.</p>
</div></div>



<p>Finally the translation is moved from the page table to the TLB to simulate caching the data. If any of these tables are full, an eviction is done before moving the data. The simulation implements a fully associative mapping, the write-back scheme, and the least recently used eviction method.</p>



<h2>How I Used It</h2>



<p><strong>I used this program to study how page size and cache size can impact the performance of a computer.</strong> In my case study, I tested 1000 random memory accesses of 8 pages versus 1000 random memory accesses from 9 pages. This seems like a tiny difference, but the outcome changed dramatically. The TLB hitrate dropped from 99% to only 87% because the data could no longer completely fit in cache.</p>



<figure class="wp-block-image size-large"><img decoding="async" width="1024" height="320" src="/wp-content/uploads/2023/02/a-1-1024x320.png" alt="" class="wp-image-569" srcset="/wp-content/uploads/2023/02/a-1-1024x320.png 1024w, /wp-content/uploads/2023/02/a-1-300x94.png 300w, /wp-content/uploads/2023/02/a-1-768x240.png 768w, /wp-content/uploads/2023/02/a-1-192x60.png 192w, /wp-content/uploads/2023/02/a-1.png 1470w" sizes="(max-width: 1024px) 100vw, 1024px" /></figure>



<div style="height:1em" aria-hidden="true" class="wp-block-spacer"></div>



<figure class="wp-block-image size-large"><img decoding="async" width="1024" height="307" src="/wp-content/uploads/2023/02/b-1-1024x307.png" alt="" class="wp-image-571" srcset="/wp-content/uploads/2023/02/b-1-1024x307.png 1024w, /wp-content/uploads/2023/02/b-1-300x90.png 300w, /wp-content/uploads/2023/02/b-1-768x230.png 768w, /wp-content/uploads/2023/02/b-1-200x60.png 200w, /wp-content/uploads/2023/02/b-1.png 1482w" sizes="(max-width: 1024px) 100vw, 1024px" /></figure>



<p><strong>Additionally, I looked at how code localization can affect the speed at which that code runs.</strong> I simulated code jumping outside of its current block 25 times versus 400 times. This resulted in a hitrate decrease of 7.5% which would cause the code to execute more slowly.</p>



<figure class="wp-block-image size-large"><img decoding="async" width="1024" height="305" src="/wp-content/uploads/2023/02/c-1-1024x305.png" alt="" class="wp-image-573" srcset="/wp-content/uploads/2023/02/c-1-1024x305.png 1024w, /wp-content/uploads/2023/02/c-1-300x89.png 300w, /wp-content/uploads/2023/02/c-1-768x229.png 768w, /wp-content/uploads/2023/02/c-1-201x60.png 201w, /wp-content/uploads/2023/02/c-1.png 1477w" sizes="(max-width: 1024px) 100vw, 1024px" /></figure>



<div style="height:1em" aria-hidden="true" class="wp-block-spacer"></div>



<figure class="wp-block-image size-large"><img decoding="async" width="1024" height="302" src="/wp-content/uploads/2023/02/d-1-1024x302.png" alt="" class="wp-image-575" srcset="/wp-content/uploads/2023/02/d-1-1024x302.png 1024w, /wp-content/uploads/2023/02/d-1-300x88.png 300w, /wp-content/uploads/2023/02/d-1-768x226.png 768w, /wp-content/uploads/2023/02/d-1-204x60.png 204w, /wp-content/uploads/2023/02/d-1.png 1473w" sizes="(max-width: 1024px) 100vw, 1024px" /></figure>



<h2>What I Learned</h2>



<p>Before writing this program I thought I had a good understanding of how virtual memory worked. In development I realized all the parts I overlooked. By the time I finished, I had gone over every detail and intricacy of the&nbsp;<strong>virtual memory hierarchy</strong>&nbsp;that&nbsp;<strong>I would consider myself an expert.</strong>&nbsp;Additionally,&nbsp;<strong>I learned the importance of understanding a project’s requirements.</strong>&nbsp;Many school assignments can be learned during development, but more complex projects need to be planned out and fully understood before starting. I also&nbsp;<strong>gain a better grasp of object-oriented best practices</strong>&nbsp;like abstraction and minimizing side effects.</p>



<h2>Link to Code</h2>



<p>Because this is a school project, I had to make the GitHub repo private. This link gives read access to the repo without making it public. <a href="https://gitfront.io/r/danielbiller/4e3be0eeccbf49ccf096814a54b205ca45710a08/Virtual-Memory-Simulation/" target="_blank" rel="noreferrer noopener">Virtual Memory Simulation Code</a></p>
]]></content:encoded>
					
		
		
			</item>
	</channel>
</rss>
