Jekyll2023-11-03T16:11:52+00:00https://luplab.cs.ucdavis.edu/feed.xmlLupLab @ UC DavisJoël Porquet-Lupine's Computer Science Education Research Lab at UC Davis.Joël Porquet-LupineExponent bias2023-11-02T16:42:00+00:002023-11-02T16:42:00+00:00https://luplab.cs.ucdavis.edu/2023/11/02/exponent-bias<h1 id="introduction">Introduction</h1>
<!-- excerpt-start -->
<p>This quarter (FQ23), I am teaching our lower-div course on computer organization
and assembly language (ECS 50). The first couple of weeks are dedicated to how
various types of data are represented in the computer. For instance, we study
unsigned integers, signed integers, characters, and floating-point numbers.</p>
<p>In one of my slides about floating-point numbers, I briefly mention that the
exponent is stored as a “biased value” but every time in lecture, I struggle to
decide how much details I should provide. If I don’t give much detail, then
students can get confused as to why the exponent’s value is simply not stored
directly as a signed integer. On the other hand, if I start diving into the
reasons for storing the exponent as a biased value, I could probably spend a
whole lecture on it!</p>
<p>So I decided to explain the whole reasoning behind the exponent bias here
(spoiler: it has to do with comparisons between floating-point numbers). This
way I’ll be able to refer students to this article next time I teach this class!</p>
<!-- excerpt-stop -->
<h1 id="unsigned-integers">Unsigned integers</h1>
<p>Let’s start from the beginning with the representation of unsigned integers.
Unsigned integers are integers that can hold a null or positive value.</p>
<p>The bits composing an unsigned integers directly represent their magnitude, by
adding the corresponding powers of two. So, for example, when considering 8-bit
word <code class="language-plaintext highlighter-rouge">01101000</code> as an unsigned integer, it gets interpreted as $0*2^7 + 1*2^6</p>
<ul>
<li>1*2^5 + 0*2^4 + 1*2^3 + 0*2^2 + 0*2^1 + 0*2^0 = 64 + 32 + 8 = 104$ in
decimal.</li>
</ul>
<h2 id="comparison-of-unsigned-integers">Comparison of unsigned integers</h2>
<p>Comparing the magnitudes of two unsigned words is conceptually straightforward.
Starting from the most significant bit (MSB), the first integer that has a <code class="language-plaintext highlighter-rouge">1</code>
that the other doesn’t is the greater number. Here is an example between two
8-bit words that contain unsigned integers:</p>
<p><img src="/assets/biased-exponent/unsigned_comparison.svg" alt="Unsigned comparison" width="50%" /></p>
<p>In practice, hardware comparators are able to compare all the bits of two N-bit
words at the same time (say, words <code class="language-plaintext highlighter-rouge">A</code> and <code class="language-plaintext highlighter-rouge">B</code>), and output whether <code class="language-plaintext highlighter-rouge">A < B</code>, or
<code class="language-plaintext highlighter-rouge">A > B</code>, or <code class="language-plaintext highlighter-rouge">A == B</code>.</p>
<p>Here is an example of a 4-bit comparator:</p>
<p><img src="/assets/biased-exponent/unsigned_comparator.png" alt="Unsigned comparator" width="100%" /></p>
<h1 id="signed-integers">Signed integers</h1>
<p>Signed integers are integers that can hold a negative, null, or positive value.</p>
<p>The most common approach to encode signed integers is called <em>two’s complement</em>.</p>
<p>In this approach, the word’s MSB acts as a sign bit. If a signed word has its
MSB set to <code class="language-plaintext highlighter-rouge">0</code>, then it contains a positive value which can be decoded by simply
determining the magnitude represented by the remaining bits (just like the
unsigned interpretation). In that case, the sign bit itself carries no value
(i.e., it is not associated to a power of two), which makes sense since it’s
worth <code class="language-plaintext highlighter-rouge">0</code> anyway.</p>
<p><img src="/assets/biased-exponent/signed_positive.svg" alt="Signed positive" width="75%" /></p>
<p>However, if the sign bit is <code class="language-plaintext highlighter-rouge">1</code>, then it is meant to represent a base value of
$-2^{w-1}$ where $w$ is the word size. The remaining $w-1$ bits are then
interpreted as an unsigned integer, and represent a (positive) offset from the
negative base value set by the sign bit.</p>
<p><img src="/assets/biased-exponent/signed_negative.svg" alt="Signed negative" width="100%" /></p>
<h2 id="comparison-of-signed-integers">Comparison of signed integers</h2>
<p>Comparing two signed words is slightly more involved than with unsigned
integers.</p>
<ul>
<li>If the two signed integers have opposite sign bits, then the integer with the
positive sign (i.e., sign bit of <code class="language-plaintext highlighter-rouge">0</code>) is the greatest. We don’t even need to
compare any other bits.</li>
<li>If the two signed integer have the same sign bit, then we have to compare
their magnitude (expressed by the $w-1$ remaining bits).
<ul>
<li>For positive signed integers, it’s straightforward since the magnitude
directly encodes the value.</li>
<li>For negative signed integers, it actually just works too, since the
integer with the bigger (positive) magnitude will be the one that is the
further away from the negative base value, which means the closest to 0,
which means the greater number! See example below.</li>
<li>In either case, we can use the same type of comparator as for unsigned
integers, but only on the $w-1$ lower bits.</li>
</ul>
</li>
</ul>
<p>Here is an example of comparing two negative numbers:</p>
<p><img src="/assets/biased-exponent/signed_comparison.svg" alt="Signed comparison" width="100%" /></p>
<h1 id="floating-point-numbers">Floating-point numbers</h1>
<p>Floating point numbers are typically represented using the IEEE 754 standard, in
their binary normalized scientific notation: $\pm~M*2^E$.</p>
<h2 id="intro">Intro</h2>
<p>For example, number $+1101.1001$, which represents $+ 2^3 + 2^2 + 2^0 + 2^{-1} +
2^{-4} = +13.5625$ in decimal, can be rewritten as $+1.1011001*2^3$ in its
binary normalized scientific notation. The sign is positive ($+$), $M$ is known
as the mantissa and only has one digit before the binary point ($1.1011001$),
and the exponent $E$ (worth $3$ here) is the power of two multiplying the
mantissa to adjust the binary point.</p>
<p>This is akin to representing rational decimal numbers using the normalized
scientific notation. For instance, number $-4,321.768$ can be expressed as
$-4.321,768 * 10^3$.</p>
<h2 id="format-basics">Format: basics</h2>
<p>In single precision (i.e., <code class="language-plaintext highlighter-rouge">float</code> in C), a floating point number is encoded in
a 32-bit word. In this format, the sign is expressed by the top bit, the <code class="language-plaintext highlighter-rouge">exp</code>
field on <code class="language-plaintext highlighter-rouge">8</code> bits is meant to represent the exponent $E$, and the <code class="language-plaintext highlighter-rouge">frac</code> field
on <code class="language-plaintext highlighter-rouge">23</code> bits represents the fractional part of $M$.</p>
<p><img src="/assets/biased-exponent/fp_format_single.svg" alt="float" width="75%" /></p>
<p>If $E$ is negative, we can represent very tiny numbers, such as
$1.0*2^{-42}=0.000,000,000,000,227,373,675,443,232,1$. If $E$ is positive, we
can represent very large numbers, such as $1.0*2^{42}=4,398,046,511,104$. Since
<code class="language-plaintext highlighter-rouge">exp</code> is on 8 bits, it gives 256 possible combinations that we can use to
represent a contiguous range of negative and positive numbers centered around
$0$. For example, if we assumed some standard two’s complement method, it could
represent range $[-128,127]$ (it’s just an example though, because it is not
what <code class="language-plaintext highlighter-rouge">exp</code> represents).</p>
<p>Given a certain value $E$, all the combinations of <code class="language-plaintext highlighter-rouge">frac</code> give $2^{23}$
equispaced values in the range $[2^E,2^{E+1})$. If $E$ is incremented by one, it
opens a new interval of $2^{23}$ equispaced values, which has no overlap with
the previous interval.</p>
<p><img src="/assets/biased-exponent/fp_normalized.svg" alt="float" width="100%" /></p>
<p>In terms of comparison, we can then already observe a few things. First, if two
numbers have opposite signs, then the positive number is automatically the
greatest. Otherwise, we have to then consider the signed value of $E$. That is,
between two floating-point numbers, the one with the greatest $E$ value is the
greater number. Finally, if both numbers have the same sign and the same $E$,
then the number with the greatest $M$, that is the greatest <code class="language-plaintext highlighter-rouge">frac</code> field, is the
greater number.</p>
<h2 id="format-advanced">Format: advanced</h2>
<p>$E$ is actually not directly stored in <code class="language-plaintext highlighter-rouge">exp</code> as a signed integer, as
hypothesised above. Instead, it is stored as a “biased value”. This means that
$E$, which is meant to belong to a contiguous range of 256 negative and positive
numbers centered around 0, is offset by a bias in order to be stored in <code class="language-plaintext highlighter-rouge">exp</code> as
a strictly positive value (i.e., an unsigned integer).</p>
<p>The bias for single-precision floating-point numbers (<code class="language-plaintext highlighter-rouge">float</code>) is set to $127$.</p>
<p>So for instance, if, for a given float, the <code class="language-plaintext highlighter-rouge">exp</code> field contains combination
<code class="language-plaintext highlighter-rouge">00101010</code> (decoded as an unsigned integer as $42$), it would in fact represent
an exponent $E = 42 - 127 = -85$, which is negative. The float would be a rather
small number.</p>
<p>In this other direction, if we tried to represent a large floating point number
such as $1.frac * 2^{42}$ (we don’t care about the mantissa here), then $E$
would be equal to $42$, but it would be stored in field <code class="language-plaintext highlighter-rouge">exp</code> as $42 + 127 =
169$ after being offset by the bias.</p>
<h2 id="comparison-of-floating-point-numbers">Comparison of floating-point numbers</h2>
<p>Why are we using this biased representation for $E$? Well, it has to do with
being able to compare floating-point numbers very quickly and efficiently!</p>
<h3 id="naive-approach">Naive approach</h3>
<p>Let’s start by considering the case where $E$ was stored in <code class="language-plaintext highlighter-rouge">exp</code> directly as a
signed integer, using the two’s complement method. In that case, the range of
$E$ would be $[-128, 127]$. If we had to compare two floats, it would be fairly
complex because we’d have to look at the sign bit, and then we’d have to apply
the comparison method for signed integers on the <code class="language-plaintext highlighter-rouge">exp</code> field:</p>
<ul>
<li>If the two floats have opposite sign bits, then the float with the
positive sign (i.e., sign bit of <code class="language-plaintext highlighter-rouge">0</code>) is the greatest. We don’t even need to
compare any other bits.</li>
<li>If the two floats have the same sign bit, then we have to compare
their <code class="language-plaintext highlighter-rouge">exp</code> field as signed integers (same technique as explained above).
<ul>
<li>If the two signed exponents have opposite sign bits, then the exponent
with the positive sign (i.e., sign bit of <code class="language-plaintext highlighter-rouge">0</code>) is the greatest.</li>
<li>If the two signed exponents have the same sign bit, then we have to compare
their magnitude (expressed by the $7$ remaining bits).
<ul>
<li>For positive signed integers, it’s straightforward since the magnitude
directly encodes the value.</li>
<li>For negative signed integers, it actually just works too, since the
integer with the bigger (positive) magnitude will be the one that is the
further away from the negative base value, which means the closest to 0,
which means the greater number!</li>
<li>In either case, we can use the same type of comparator as for unsigned
integers, but only on the $7$ lower bits.</li>
</ul>
</li>
</ul>
</li>
<li>If the two floats have the same exponent, then we have to compare their <code class="language-plaintext highlighter-rouge">frac</code>
field as unsigned integers. Whichever float has the largest magnitude is the
greater number.</li>
</ul>
<p>As you can see, we have to nest the signed comparison of the exponent, after
having considered the sign of the floats themselves. Doing this type of
comparison would require a specific, and complicated type of comparator.</p>
<h3 id="biased-approach">Biased approach</h3>
<p>Now, if we store the exponent of a floating-point number as a biased value, it
becomes an unsigned integer, which considerably simplifies the comparison of two
floats. In that case, the comparison becomes:</p>
<ul>
<li>If the two floats have opposite sign bits, then the float with the positive
sign is the greatest. We don’t even need to compare any other bits.</li>
<li>If the two floats have the same sign bit, then we can compare all the
following bits as a magnitude.
<ul>
<li>The number with the bigger exponent will appear to have a bigger
magnitude.</li>
<li>If the two numbers have the same exponent, the fractional part of the
mantissa will become relevant and whichever has the bigger fractional part
will also appear to have a bigger magnitude.</li>
<li>In either case, we can use the same type of comparator as for unsigned
integers, on all the bits after the sign bit.</li>
</ul>
</li>
</ul>
<p>Hopefully, you’ve noticed that we can use the same type of comparator as for
signed integers to compare floats, which makes things so much easier since we
already have them in any standard processor!</p>
<h1 id="conclusion">Conclusion</h1>
<p>By storing the exponent of a floating-point number as a biased value, we enable
comparing floating-point numbers as if they were simple signed integers, that is
using the same type of comparator.</p>Joël Porquet-LupineIntroduction This quarter (FQ23), I am teaching our lower-div course on computer organization and assembly language (ECS 50). The first couple of weeks are dedicated to how various types of data are represented in the computer. For instance, we study unsigned integers, signed integers, characters, and floating-point numbers. In one of my slides about floating-point numbers, I briefly mention that the exponent is stored as a “biased value” but every time in lecture, I struggle to decide how much details I should provide. If I don’t give much detail, then students can get confused as to why the exponent’s value is simply not stored directly as a signed integer. On the other hand, if I start diving into the reasons for storing the exponent as a biased value, I could probably spend a whole lecture on it! So I decided to explain the whole reasoning behind the exponent bias here (spoiler: it has to do with comparisons between floating-point numbers). This way I’ll be able to refer students to this article next time I teach this class!Quarterly update SS232023-10-27T16:17:00+00:002023-10-27T16:17:00+00:00https://luplab.cs.ucdavis.edu/2023/10/27/quarterly-update-ss23<!-- excerpt-start -->
<p>Here is our status at the end of the summer 2023.</p>
<!-- excerpt-stop -->
<ul>
<li>Noah Krim was hired as a full-time intern at LupLab. He got closed to
finishing <a href="https://gitlab.com/luplab/vrv">VRV (Virtual RISC-V)</a>, our port of
<a href="https://spimsimulator.sourceforge.net/">SPIM</a> to RISC-V. By the end of the
summer, the emulator engine was done and he was halfway through the GUI. We
will use VRV in ECS 50 (our intro to computer organization course) in the
Fall!</li>
<li>The work on <a href="https://gitlab.com/luplab/lupbook">LupBook</a> made some good
progress. Arnav Rastogi and Russell Umboh finished developing their
multi-choice question interactive component, and Yusen Ma, an exchange student
from Nanjing University via the UC Davis GREAT program, developed two more
interactive components. He implemented fill-in-the-blanks questions, and
parsons exercises. He received an award from the GREAT program for his work!</li>
<li>Niharika Misal and Saili Karkare, who will work on our current CS study
looking at the perception of success and actual success between native
students and transfer students, applied to the
<a href="https://cra.org/ur2phd/">UR2PhD</a> program and got accepted! This program is
organized by the CRA and focused on engaging more women and
gender-marginalized students into computing PhD programs.</li>
<li>With the help of Brian Nguyen, we were able to run the RISC-V implementation
<a href="https://github.com/openhwgroup/cva6">CVA6</a> on one of our FPGA cards. Next
step is to test the few <a href="https://gitlab.com/luplab/lupio/lupio-specs">LupIO</a>
devices we implemented for CVA6 and implement the rest of the collection.</li>
<li>On my end, I’ve been working almost full time on <code class="language-plaintext highlighter-rouge">xv88</code>, a fork of
<a href="https://github.com/mit-pdos/xv6-riscv">xv6</a>, which goal is to implement a
simple but realistic operating system that I can use in ECS 150, our OS
undergrad course.</li>
</ul>Joël Porquet-LupineHere is our status at the end of the summer 2023.Quarterly update SQ232023-07-20T14:14:00+00:002023-07-20T14:14:00+00:00https://luplab.cs.ucdavis.edu/2023/07/20/quarterly-update-sq23<!-- excerpt-start -->
<p>Here is our status at the end of the spring quarter 2023.</p>
<!-- excerpt-stop -->
<ul>
<li>Noah Krim has continued improving
<a href="https://luplab.gitlab.io/rvcodecjs/">rvcodec.js</a> on his spare time, when he
wasn’t buried under project grading for ECS 150! A few bugs were fixed, and
the management of rounding modes for floating point instructions was added.</li>
<li>Noah also continued working on VRV (Virtual RISC-V), our port of
<a href="https://spimsimulator.sourceforge.net/">SPIM</a> to RISC-V. We identified and
isolated the smallest subset of the original application
(lexer+parser+instruction data structure) that we could port first in order to
have a working base and expand the port from there. Noah will work on this
project full-time during the summer.</li>
<li>For our current CS study looking at the perception of success and actual
success between native students and transfer students, we made some good
progress. Our IRB proposal was approved (that is, officially “exempted from
review”) and so we were able to run our first batch of surveys with 3rd and
4th year CS/CSE students, and gather the data from student records with the
help of Prof. Nitta. We will work on analyzing everything in the Fall.</li>
<li>Our reboot of <a href="https://luplab.gitlab.io/includecs/"><code class="language-plaintext highlighter-rouge">#include<cs></code></a> has seen
its first new episode after an unfortunate three-year break (caused by the
pandemic)! This episode was produced by Saili Karkare and talks about the
impact of early CS education. It is available on the website or on your
favorite podcast app.</li>
<li>We completed and merged two hardware devices in
<a href="https://gitlab.com/luplab/lupio">LupIO</a>: LupIO-RNG (random number generator)
and LupIO-TMR (timer). Two other devices, LupIO-PIC (programmable interrupt
controller) and LupIO-RTC (real-time clock) are close to the finish line.</li>
<li>Finally, we restarted the work on
<a href="https://gitlab.com/luplab/lupbook">LupBook</a>, our interactive textbook
framework. Arnav Rastogi and Russell Umboh are currently developing a
multi-choice question interactive component.</li>
</ul>Joël Porquet-LupineHere is our status at the end of the spring quarter 2023.Best professor of the year award from CS club2023-06-06T22:31:00+00:002023-06-06T22:31:00+00:00https://luplab.cs.ucdavis.edu/2023/06/06/best-professor-of-the-year-award-from-cs-club<p>After recently earning two institutional teaching awards (from my department and
my college), I also received the Best Professor of the Year Award from the Davis
Computer Science Club while attending their annual banquet last Friday. What a
year!</p>Joël Porquet-LupineAfter recently earning two institutional teaching awards (from my department and my college), I also received the Best Professor of the Year Award from the Davis Computer Science Club while attending their annual banquet last Friday. What a year!Notes from WiCS faculty panel event2023-06-01T16:46:00+00:002023-06-01T16:46:00+00:00https://luplab.cs.ucdavis.edu/2023/06/01/notes-from-wics-faculty-panel-event<h2 id="introduction">Introduction</h2>
<!-- excerpt-start -->
<p>I was recently invited to speak at a faculty panel event hosted by the Women in
Computer Science (WiCS) at UC Davis. Since I had received a list of questions in
advance, I had taken the opportunity to prepare some notes for the event. Now
that the event has happened, I’ve expanded upon these notes, based on what I
actually said during the event. I hope that someone will find these revised
notes useful!</p>
<!-- excerpt-stop -->
<h2 id="panel-questions">Panel questions</h2>
<h3 id="background">Background</h3>
<ul>
<li><strong>Tell us about yourself–current position, department, how long you have been
at UC Davis</strong></li>
</ul>
<p>I have been at UC Davis for seven years! I first started in WQ17 as a temporary
part-time lecturer, initially to teach ECS 150, before quickly becoming a
full-time lecturer. A couple years later, I was hired for a faculty position.
It’s now been five years that I’m an Assistant Professor of Teaching, which is a
relatively new position in the UC system. My primary focus is on teaching
excellence, while my second focus is on research (which for me is geared towards
CS Education) – FYI, it is typically the other way around for regular
“research” professors, whose main focus is on research. As a faculty member, a
fair amount of my time is also spent on service duties, such as working on the
accreditations of our majors, hiring/reviewing lecturers, and a bunch of other
<del>fun</del> tasks.</p>
<ul>
<li><strong>How did you get to where you are now?</strong></li>
</ul>
<p>Probably by a lucky mix of hard work and privilege.</p>
<p>They’re now long retired but my parents both graduated with a PhD and worked in
academia during their entire career. As a kid, I used to spend a fair amount of
time at my mom’s office, doing my homework, playing on her computer, and hanging
out with her students and colleagues. When I became a college student myself
some years later, it felt natural to embark on a PhD and pursue an academic
career. It’s also been very useful all through my academic career thus far to be
able to ask my parents for advice.</p>
<p>Now, don’t get me wrong; obtaining a PhD, holding multiple postdoc positions,
being recruited in this job, etc. was really hard, and included working long
hours, often suffering from insomnia, feeling miserable at times, etc.! But at
least, I rarely felt like I didn’t belong, which removed a big burden that many
people may otherwise experience.</p>
<p>I started by doing research in hardware security mechanisms. But after a PhD and
a postdoc in this field, I realized that disciplinary research wasn’t for me and
also found research in computer architecture frustrating. It is typically too
expensive to implement anything physically, so research ideas are often
developed in simulators only. I then pivoted towards kernel development, which
was a lot more fun. The project of porting the Linux kernel to a novel 96-core
processor architecture will always be one of my biggest achievements. With my
new skills in kernel development, I worked in the industry for a little bit, and
while it was a great experience, I had a hard time finding purpose working on
industrial projects. That’s when I applied to UC Davis for a lecturer position,
and found a passion for becoming an educator.</p>
<ul>
<li><strong>What were you involved with as an undergrad student? Research, clubs,
classes, social life?</strong></li>
</ul>
<p>In France, our education system works very differently. As an undergrad, most of
my work was done in class. I’d have lectures and various types of labs
throughout the entire day. On average, I’d typically have class from 9-5 with a
1-hour lunch break. Unlike here, I’d have very little homework outside of class
(especially if I was able to finish my labs within the allotted time, which was
usually the case). Once class was over for the day, I’d have the entire evening
to hang out with my friends, watch movies, play video games, walk around in
Paris, etc. :)</p>
<h3 id="being-a-professor">Being a professor</h3>
<ul>
<li><strong>What does a typical day look like for you?</strong></li>
</ul>
<p>It really depends on the day and on the quarter.</p>
<p>The days I’m teaching, I’ll typically spend most of the day on teaching-related
tasks, such as preparing my lecture (reviewing my slides, and/or making some
adjustments to them), holding a couple of office hours, publishing grades,
sending announcements on Canvas, etc. I may also try to squeeze in some
service-related tasks, such as participating in various committee meetings,
writing documents, etc.</p>
<p>Since I usually teach three days a week (MWF), it leaves two days for
research-related tasks. This quarter, I’ve used my Tuesdays to have most of my
research meetings. This is when I meet with the students in my lab and discuss
their progress on our projects. On Thursdays, I typically stay home and try my
best not to schedule any meetings, so that I can fully focus on some research
projects (or write an article for this website!).</p>
<ul>
<li><strong>What did you like most about your work/job?</strong></li>
</ul>
<p>Many things! :D</p>
<p>First, I like the overall purpose of my job. I truly enjoy being in the
classroom and helping students learn about computer science so that one day they
can have a successful career in this field. I also enjoy that all my research
activities are focused on education, and how to make it more accessible and
inclusive.</p>
<p>Second, in terms of logistics, I like the flexibility of this job and not having
a boss. I’m regularly evaluated (every two years for merits, and on average
every 5 to 6 years for promotions) so there are clear expectations to deliver
results, such as being recognized as an excellent teacher, being involved in
education-related research projects, etc. However, no one is over my shoulder
every day. As long as I achieve these results, I have full control on my time
and on the process I choose to follow.</p>
<ul>
<li><strong>What is your favorite class to teach and why?</strong></li>
</ul>
<p>Most of the classes that I teach are core courses in the CS curriculum: ECS 36C
(data structures), ECS 50 (computer organization), ECS 150 (operating systems).
I honestly love teaching all of them equally. It’s awesome to teach foundational
topics to students and see them grow as computer scientist over the span of just
one quarter.</p>
<p>I only teach one CS elective, which is ECS 158 (programming on parallel
architectures). It’s a fun class to teach, especially since I often get the best
students from ECS 150!</p>
<ul>
<li><strong>Have you ever faced discrimination, microagressions, or conflict in the
workplace? If so, how did you deal with that?</strong></li>
</ul>
<p>Luckily, I have not faced any discrimination in my career so far.</p>
<p>If ever I face some microagressions (e.g., having an accent and/or making
language mistakes sometimes prompts people to make mocking comments), I
typically try my best to confront my offender and let them know that I didn’t
appreciate their comment(s).</p>
<p>I have had lots of work conflicts during my career. The best advice I’ve
received is to have live conversations with people when there are issues to
address. It’s especially easy to get upset and get into arguments online (e.g.,
over email, or chat), but a good, old face-to-face conversation usually does the
trick to finding common grounds and solving conflicts.</p>
<p>Finally, we often talk about being on the receiving end of microagressions but
we should also acknowledge that we’re sometimes the “aggressors” too. I’ve
personally committed my fair share of microaggressions, and probably still do.
So I try my very best to listen to people’s feedback and adjust my behavior
accordingly. For example, I always read my course evaluations entirely and very
carefully at the end of each quarter, and if I see that a number of students
complain about the same thing (for instance, that I was unnecessarily harsh on
the online forum for a particular class), I will try to think of ways I can
prevent that from happening in the future.</p>
<h3 id="advice">Advice</h3>
<ul>
<li><strong>Were there any misconceptions or assumptions that you had about being a
professor that proved to be false – or true? (Expectations vs. reality)</strong></li>
</ul>
<p>Honestly, not so much. I admired many of my professors when I was a student and
could tell how much work it seemed to represent. Now that I’m a professor, I
feel like it matched what I expected.</p>
<ul>
<li><strong>In your career, if you had it to do all over again, what would you do
differently?</strong></li>
</ul>
<p>It’s hard to answer. I’m so happy to be where I am today that I can’t regret any
decisions I made. Even the numerous failures I experienced contributed to me
landing here, so in many ways, they were useful failures!</p>
<p>If I really had to find one thing, I may say that I wish I had studied abroad
earlier. My first experience abroad was in India, in between my master’s and
PhD, and it was an eye opening experience between in a foreign country, speaking
another language, and being surrounded by another culture. That’s what
motivated me to apply for a postdoc in the US after my PhD, and eventually
brought me here today.</p>
<ul>
<li><strong>It’s common for students to be nervous about attending office hours. What
kinds of questions do you wish your students would ask more often?</strong></li>
</ul>
<p>I wish students asked me less questions about class and more questions about
life in general!</p>
<p>There are so much more that professors can provide, beyond helping students on a
particular homework. Whenever students approach me like I’m not (only) a
resource towards their academic success, they quickly see that I’m also a human
being with an interesting story to tell and a supportive ear. Among the many
students who gave it a try over the years, I have occasionally formed meaningful
friendships.</p>
<ul>
<li><strong>Women in STEM sometimes face bias or feel isolated in their majors, leading
them to switch to different paths. What would you say to a female-identifying
student contemplating leaving CS or Engineering because she feels unsupported
or “not smart enough.”</strong></li>
</ul>
<p>From my many interactions with female students (and even some of my own work on
gender and class participation in CS classes), I know the struggle is
unfortunately real.</p>
<p>I would encourage students to find a trusted mentor (like an older student, or a
faculty) and/or make a tight group of STEM friends, and use them to support you
throughout your CS journey. Whenever you have any doubts or face any hardships,
you’ll have people to go for a friendly ear, advice, etc.</p>
<h3 id="misc">Misc</h3>
<ul>
<li><strong>What is an interesting fact about yourself or your journey that students are
surprised to learn?</strong></li>
</ul>
<p>Unrelated to CS but since we’re in CA, I used to be into skateboarding a long
long time ago! At the peak of my skateboarding abilities, I could do a
360-kickflip and I could ollie over 2 feet 🛹.</p>Joël Porquet-LupineIntroduction I was recently invited to speak at a faculty panel event hosted by the Women in Computer Science (WiCS) at UC Davis. Since I had received a list of questions in advance, I had taken the opportunity to prepare some notes for the event. Now that the event has happened, I’ve expanded upon these notes, based on what I actually said during the event. I hope that someone will find these revised notes useful!Two teaching awards2023-05-09T22:06:00+00:002023-05-09T22:06:00+00:00https://luplab.cs.ucdavis.edu/2023/05/09/two-teaching-awards<p>I’m proud to announce that I won the 2023 “Outstanding Faculty Teaching Award”
from the College of Engineering, as well as the “Excellence in Teaching Award”
from the CS department.</p>Joël Porquet-LupineI’m proud to announce that I won the 2023 “Outstanding Faculty Teaching Award” from the College of Engineering, as well as the “Excellence in Teaching Award” from the CS department.LupLab received two high-end FPGA kits from AMD/Xilinx2023-04-27T18:27:00+00:002023-04-27T18:27:00+00:00https://luplab.cs.ucdavis.edu/2023/04/27/luplab-received-two-high-end-fpga-kits-from-xilinx-university-program<p>LupLab has just received two <a href="https://www.xilinx.com/products/boards-and-kits/ek-k7-kc705-g.html">AMD Kintex7 FPGA KC705 Evaluation
Kits</a>,
generously gifted by the <a href="https://www.xilinx.com/support/university.html">AMD/Xilinx University
Program</a>. We plan to use these
kits as part of our <a href="https://gitlab.com/luplab/lupio/">LupIO project</a>.</p>Joël Porquet-LupineLupLab has just received two AMD Kintex7 FPGA KC705 Evaluation Kits, generously gifted by the AMD/Xilinx University Program. We plan to use these kits as part of our LupIO project.LupLab received a $50K gift from private donors!2023-04-06T17:15:00+00:002023-04-06T17:15:00+00:00https://luplab.cs.ucdavis.edu/2023/04/06/luplab-received-a-50k-gift-from-private-donors<p>LupLab recently received an amazing gift which will help hire students and
support our projects for the coming years. Thanks so much to our donors!</p>Joël Porquet-LupineLupLab recently received an amazing gift which will help hire students and support our projects for the coming years. Thanks so much to our donors!Quarterly update WQ232023-04-06T17:06:00+00:002023-04-06T17:06:00+00:00https://luplab.cs.ucdavis.edu/2023/04/06/luplab-quarterly-update-wq23<p><em>I’ve recently thought it would be interesting to share some regular updates
about LupLab’s activities. Hopefully, I can continue doing this every quarter
from now on.</em></p>
<!-- excerpt-start -->
<p>Here is our status at the end of the winter quarter 2023.</p>
<!-- excerpt-stop -->
<ul>
<li>LupLab received a $50K gift from a private donor to support our research!</li>
<li>Noah Krim and Dang Khoi Nguye Ho brought
<a href="https://luplab.gitlab.io/rvcodecjs/">rvcodec.js</a>, our RISC-V instruction
encoder/decoder project, to a stable state. We can now convert almost all of
the RISC-V instructions, and the UI/UX is visually appealing, clear, and
functional. This project will now enter maintenance mode.</li>
<li>Tyler Ottman and Noah Krim worked on porting the venerable <a href="https://spimsimulator.sourceforge.net/">SPIM MIPS
simulator</a> to RISC-V. They developed a
first prototype which, while not yet functional, seems to indicate that such a
port is doable. Since Tyler has now graduated (congrats!), Noah will take over
the project. He is planned to work full time on it over the summer so that we
can use it in FQ23 for when I’m scheduled to teach ECS 50, our computer
organization and assembly language course.</li>
<li>For our current CS study looking at the perception of success and actual
success between native students and transfer students, Niharika Misal and I
wrote our research protocol for the IRB to soon review. We also designed a
student survey, which will be sent to 3rd year students in a few weeks, and we
determined which information should be gathered from student records in order
to perform our data analysis.</li>
<li><code class="language-plaintext highlighter-rouge">#include<cs></code>, our podcast project that was on standby for a couple of years,
now has a new <a href="https://luplab.gitlab.io/includecs/">website</a> and we are
working on new episodes. I’m hoping a couple will be ready by the end of SQ23.</li>
<li><a href="https://gitlab.com/luplab/lupio">LupIO</a>, our collection of education-friendly
I/O devices, is starting to exist in hardware! Eric Liu, Brian Nguyen, and
Miles Stamp have implemented a SystemVerilog version of LupIO-RNG, the random
number generator, which has real latency and IRQ support.</li>
<li>Also on LupIO, I finished implementing a <a href="https://gitlab.com/luplab/lupio/qemu/-/commit/d058a682560d1e40ada35fdcef51e19eb25229ac">MIPS-based SMP board in
QEMU</a>
along with the <a href="https://gitlab.com/luplab/lupio/linux/-/commit/294ad720cf45af5d47c6f5f4d5473f687926baaa">support in the Linux
kernel</a>,
that only includes LupIO devices and can boot Linux. This is the third of such
boards (along with RISC-V and ARM32), therefore supporting the claim that
LupIO is the first and only existing processor-agnostic collection of I/O
devices! A paper publication will be the next step.</li>
</ul>Joël Porquet-LupineI’ve recently thought it would be interesting to share some regular updates about LupLab’s activities. Hopefully, I can continue doing this every quarter from now on. Here is our status at the end of the winter quarter 2023.Experimenting with new late penalty formula2022-12-02T21:47:00+00:002022-12-02T21:47:00+00:00https://luplab.cs.ucdavis.edu/2022/12/02/experimenting-with-new-late-penalty-formula<h2 id="introduction">Introduction</h2>
<p>During my first year of teaching at UC Davis (starting in WQ17), I had no
flexible late policy for project submissions. The deadlines were set on 11:59 PM
of specified days and late work wasn’t accepted at all. It’s a bit difficult to
remember but I imagine that I surely received some pushback from students over
time.</p>
<p>According to my archives, I introduced a more flexible late policy in SQ18. Late
project submissions were accepted but penalized at the rate of $5\%$ per hour
late, and since I didn’t want to penalize (too much) students who were just a
few minutes late, this penalty was prorated per minute. So if a group submitted
their work ten minutes late, then they would lose $10 * 5\% / 60 = 0.83\%$.</p>
<p>The problem is that if a group was still working on a nasty bug and went over
the deadline by say three hours, they would already lose $15\%$ of their grade (!),
which would de facto limit their grade to a B maximum <em>(assuming there was no
curve for the project assignment)</em>.</p>
<p>I kept this late penalty formula for four years until at the end of the last
academic year (in SQ22), a student complained more strongly than usual, which
prompt me to rethink it. <em>By the way, when professors ask students for their
feedback, please do voice your concerns – if I hear the same complaint over
time by trusted students, it really helps to know what I need to address next.</em></p>
<h2 id="new-late-penalty-formula">New late penalty formula</h2>
<!-- excerpt-start -->
<p>The idea of the new late penalty formula I developed is to remove points at an
exponential rate instead of a linear one. What is means is that the penalty for
late submission will stay reasonably small for a long time, before suddenly
shooting up to $100\%$ by a certain time.</p>
<!-- excerpt-end -->
<p>The formula that I ended up crafting is $\frac{(1.3471^x - 1)}{(1.3471 - 1)}$,
where $x$ represents the number of decimal hours late.</p>
<p>For example, submitting $1.5$ hours late will incur a penalty of $1.62\%$, while
submitting $7.2$ hours late (that is, 7 hours and 12 minutes) will incur a
penalty of $21.73\%$. It’s only after $12$ hours late, that the penalty
exponentially reaches $100\%$.</p>
<p>Overall, the formula behaves as shown on the graph below.</p>
<p><img src="/assets/late-penalty/graph.svg" alt="late penalty graph" width="75%" /></p>
<h3 id="excel-equation">Excel equation</h3>
<p>If one wanted to use this formula in a spreadsheet, such as shown in the
screenshot below, the equation for the late penalty (cell <code class="language-plaintext highlighter-rouge">C2</code>) would be:
<code class="language-plaintext highlighter-rouge">=(POWER(1.3471,(A2+(B2/60))) - 1)/(1.3471 - 1)</code></p>
<p><img src="/assets/late-penalty/excel.png" alt="excel formula" /></p>
<h2 id="conclusion">Conclusion</h2>
<p>It’s too early to tell, but after using this formula across three project
assignments this quarter, I have not heard any complaints from students!</p>
<p>It also appears that the rate of late submission has stayed the same as previous
quarters, so the new formula doesn’t seem to “incentivize” late submissions. It
only makes them less painful for students. Further analysis on this is required
though.</p>Joël Porquet-LupineIntroduction During my first year of teaching at UC Davis (starting in WQ17), I had no flexible late policy for project submissions. The deadlines were set on 11:59 PM of specified days and late work wasn’t accepted at all. It’s a bit difficult to remember but I imagine that I surely received some pushback from students over time. According to my archives, I introduced a more flexible late policy in SQ18. Late project submissions were accepted but penalized at the rate of $5\%$ per hour late, and since I didn’t want to penalize (too much) students who were just a few minutes late, this penalty was prorated per minute. So if a group submitted their work ten minutes late, then they would lose $10 * 5\% / 60 = 0.83\%$. The problem is that if a group was still working on a nasty bug and went over the deadline by say three hours, they would already lose $15\%$ of their grade (!), which would de facto limit their grade to a B maximum (assuming there was no curve for the project assignment). I kept this late penalty formula for four years until at the end of the last academic year (in SQ22), a student complained more strongly than usual, which prompt me to rethink it. By the way, when professors ask students for their feedback, please do voice your concerns – if I hear the same complaint over time by trusted students, it really helps to know what I need to address next. New late penalty formula The idea of the new late penalty formula I developed is to remove points at an exponential rate instead of a linear one. What is means is that the penalty for late submission will stay reasonably small for a long time, before suddenly shooting up to $100\%$ by a certain time. The formula that I ended up crafting is $\frac{(1.3471^x - 1)}{(1.3471 - 1)}$, where $x$ represents the number of decimal hours late. For example, submitting $1.5$ hours late will incur a penalty of $1.62\%$, while submitting $7.2$ hours late (that is, 7 hours and 12 minutes) will incur a penalty of $21.73\%$. It’s only after $12$ hours late, that the penalty exponentially reaches $100\%$. Overall, the formula behaves as shown on the graph below. Excel equation If one wanted to use this formula in a spreadsheet, such as shown in the screenshot below, the equation for the late penalty (cell C2) would be: =(POWER(1.3471,(A2+(B2/60))) - 1)/(1.3471 - 1) Conclusion It’s too early to tell, but after using this formula across three project assignments this quarter, I have not heard any complaints from students! It also appears that the rate of late submission has stayed the same as previous quarters, so the new formula doesn’t seem to “incentivize” late submissions. It only makes them less painful for students. Further analysis on this is required though.