% 
% hw1.tex
%
%   This is a LaTeX template to get you started
%   making problem-set solutions
%
 
\documentclass[11pt]{article}
\usepackage{amsmath}
\setlength{\oddsidemargin}{0in}
\setlength{\evensidemargin}{0in}
\setlength{\textheight}{9.0in}
\setlength{\textwidth}{6.5in}
\setlength{\topmargin}{-0.5in}

% *** GRAPHICS RELATED PACKAGES ***
%

\usepackage{caption}
\usepackage{subcaption}
\usepackage{graphicx}

 \graphicspath{{./}}
 \DeclareGraphicsExtensions{.pdf,.jpeg,.png}

%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
\title{\bf Data, Logic, and Computing\\[2ex] 
       \rm\normalsize ECS 17 (Winter 2025)}
\date{\today}
\author{Patrice Koehl\\koehl@cs.ucdavis.edu}

\begin{document}
\maketitle
\section*{\underline{Homework 2 }}

%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
\section*{Exercise 1} 

Assuming that there are 154,998 characters in the UNICODE, and that each character is represented with the same number of bits, what is the minimal number of bits needed to store a word with 8 characters using this code?

%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
\section*{Exercise 2} 

\begin{itemize}
\item What is the binary representation of the hexadecimal 7B?
\item What is the hexadecimal representation of the binary number 1110111?
\item How many bits are there in 21 bytes?
\item What is the largest  signed integer that can be stored on one byte?
\end{itemize}

%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
\section*{Exercise 3} 

How much space would you need to store a 6 min song that has been sampled at 44.1 kHz, with each data point stored on 16 bits, in stereo (assume no compression).

%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
\section*{Exercise 4} 

\begin{itemize}
\item Let $A$ be the binary number 1110110 and $B$ the binary number 11100010; find the binary number $C$ that satisfies $A+C = B$.
\item Let $A$ be the hexadecimal number \#3FF and $B$ the hexadecimal number \#F4F; find the hexadecimal number $C$ that satisfies $A+C = B$.
\item Let $A$ be the hexadecimal number \#3EF and $B$ the binary number 10000000000; find the hexadecimal number $C$ that satisfies $A+C = B$.
\item Let $A$ be the binary number 1000000000 and $B$ the hexadecimal number \#227; find the binary number $C$ that satisfies $A+C = B$.
\end{itemize}

\end{document}

