874 16-bit Logarithmic Approximate Floating Point Multiplier

874 : 16-bit Logarithmic Approximate Floating Point Multiplier

Design render
  • Author: Anwesh Rao, B S Gurucharan, Shreyas M Iliger, Tushar M, Shylashree N, RV College of Engineering
  • Description: A 16-bit floating-point multiplier utilizing logarithmic approximation to achieve fast and power-efficient floating-point multiplication with reduced hardware.
  • GitHub repository
  • Open in 3D viewer
  • Clock: 50000000 Hz

📌 Credits

We sincerely acknowledge the Center of Excellence in Integrated Circuits and Systems (CoE-ICAS) and the Department of Electronics and Communication Engineering, RV College of Engineering, Bengaluru, for their invaluable support in providing us with the necessary knowledge and training.

We extend our special gratitude to Dr. H V Ravish Aradhya (HoD, ECE), Dr. K S Geetha (Vice Principal) and Dr. K N Subramanya (Principal) for their continuous encouragement and support, enabling us to achieve TAPEOUT in Tiny Tapeout 10.

We are also deeply grateful to Mahaa Santeep G (RVCE Alumni) for his mentorship and invaluable guidance throughout the completion of this project.

The code provided is a Verilog module that implements a 16-bit logarithmic approximate floating-point multiplier. This module utilizes logarithmic approximation techniques to perform floating-point multiplication efficiently, reducing computational complexity while maintaining accuracy. It incorporates a state machine that processes the LSB(lower 8 bits) of the inputs in the first cycle and the MSB(upper 8 bits) in the next cycle, subsequently producing the LSB(lower 8 bits) of the output first, followed by the MSB(upper 8 bits) in the next cycle.

Key Components

The Logarithmic Approximate Floating-Point Multiplier (LAFPM) is a hardware-efficient multiplier that processes two 16-bit floating-point numbers using logarithmic approximation techniques. Instead of traditional multiplication, this design reduces complexity by leveraging logarithmic transformations, shifts, and additions. This approach significantly lowers power consumption and area, making it ideal for resource-constrained applications such as machine learning accelerators and embedded systems. The multiplier operates using a finite state machine (FSM) that progresses through several key states:

IDLE – The system remains in this state until a non-zero input is detected. Once an input is received, it transitions to the next stage.

COLLECT – The multiplier collects the two 8-bit portions of each operand over multiple cycles to reconstruct the 16-bit floating-point numbers. After both parts are received, it moves to processing.

PROCESS_1 – The floating-point components, including the sign, exponent, and mantissa, are extracted for further computation.

PROCESS_2 – The mantissas undergo logarithmic approximation through bit-shifting techniques, reducing the complexity of multiplication.

PROCESS_3 – The approximated mantissas are added together using a logarithmic-based summation.

PROCESS_4 – A carry-out bit is determined, which helps adjust the exponent in the next stage.

PROCESS_5 – The new exponent is computed, and an additional approximation step refines the mantissa for better accuracy.

PROCESS_6 – The final floating-point result is assembled, combining the computed sign, exponent, and mantissa.

OUTPUT – The computed result is transmitted over multiple cycles. Once completed, the system returns to the IDLE state, ready for the next operation.

Inputs and Clock Frequency

u_in and uio_in are used to receive operands A and B through multiple cycles.

rst_n is the active-low reset signal.

clk operates at a 50 MHz frequency.

Table: State Transition for FP-16 Multiplication of (0x43BC)*(0x4190)

Time (ns) ui_in (Input A) uio_in (Input B) Reset State uo_out (Output) Clock
0 00000000 00000000 0 Reset xxxxxxxx 0
10 00000000 00000000 0 Reset 00000000 1
20 10111100 10010000 1 Reset 00000000 0
30 10111100 10010000 1 IDLE 00000000 1
50 10111100 10010000 1 COLLECT_1 00000000 1
60 01000011 01000001 1 COLLECT_1 00000000 0
70 01000011 01000001 1 COLLECT_2 00000000 1
90 01000011 01000001 1 PROCESS_1 00000000 1
110 01000011 01000001 1 PROCESS_2 00000000 1
130 01000011 01000001 1 PROCESS_3 00000000 1
150 01000011 01000001 1 PROCESS_4 00000000 1
170 01000011 01000001 1 PROCESS_5 00000000 1
190 01000011 01000001 1 PROCESS_6 00000000 1
210 01000011 01000001 1 OUTPUT_1 01110101 1
220 01000011 01000001 1 OUTPUT_1 01110101 0
230 01000011 01000001 1 OUTPUT_2 01001001 1
240 01000011 01000001 1 OUTPUT_2 01001001 0

Other Operands can also given as follows: Table: Multiple Operands with Expected output

Input A Input B Output
0x4871 0x482e 0x54a6
0x41bd 0x46ef 0x4d31
0x436c 0x45aa 0x4d4c
ox44df 0x483d 50x12c

IO

#InputOutputBidirectional
0A[0]/A[8]P[0]/P[8]B[0]/B[8]
1A[1]/A[9]P[1]/P[9]B[1]/B[9]
2A[2]/A[10]P[2]/P[10]B[2]/B[10]
3A[3]/A[11]P[3]/P[11]B[3]/B[11]
4A[4]/A[12]P[4]/P[12]B[4]/B[12]
5A[5]/A[13]P[5]/P[13]B[5]/B[13]
6A[6]/A[14]P[6]/P[14]B[6]/B[14]
7A[7]/A[15]P[7]/P[15]B[7]/B[15]

Chip location

Controller Mux Mux Mux Mux Mux Mux Mux Mux Mux Mux Mux Analog Mux Mux Mux Mux Mux Mux Mux Mux Mux Mux Mux Analog Mux Mux Mux Mux Mux Mux Mux Mux Mux Mux tt_um_chip_rom (Chip ROM) tt_um_factory_test (Tiny Tapeout Factory Test) tt_um_oscillating_bones (Oscillating Bones) tt_um_urish_charge_pump (Dickson Charge Pump) tt_um_sonos_flash_party (SONOS Flash Party) tt_um_4Bit_SAR_ADC (4-Bit Successive Approximation ADC) tt_um_cw_vref (Current-Mode Bandgap Reference) tt_um_tt08_aicd_playground (AICD Playground) tt_um_tnt_diff_rx (TT08 Differential Receiver test) tt_um_rejunity_vga_logo (VGA Tiny Logo (1 tile)) tt_um_tommythorn_maxbw (Asynchronous Multiplier) tt_um_rebeccargb_universal_decoder (Universal Binary to Segment Decoder) tt_um_mattvenn_rgb_mixer (RGB Mixer demo5) tt_um_rebeccargb_hardware_utf8 (Hardware UTF Encoder/Decoder) tt_um_find_the_damn_issue (Find The Damn Issue) tt_um_brandonramos_VGA_Pong_with_NES_Controllers (VGA Pong with NES Controllers) tt_um_kb2ghz_xalu (4-bit minicomputer ALU) tt_um_rebeccargb_intercal_alu (INTERCAL ALU) tt_um_a1k0n_demo (Demo by a1k0n) tt_um_rburt16_bias_generator (Bias Generator) tt_um_zec_square1 ("SQUARE-1": VGA/audio demo) tt_um_jmack2201 (Sprite Bouncer with Looping Background Options) tt_um_ran_DanielZhu (Dice) tt_um_gfg_development_tinymandelbrot (TinyMandelbrot) tt_um_LnL_SoC (Lab and Lectures SoC) tt_um_htfab_pi_snake (Pi Snake) tt_um_quarren42_demoscene_top (asic design is my passion) tt_um_crispy_vga (Crispy VGA) tt_um_MichaelBell_canon (TT08 Pachelbel's Canon demo) tt_um_shuangyu_top (Calculator) tt_um_wokwi_407306064811090945 (DDR throughput and flop aperature test) tt_um_08_sws (Sine Wave Synthesizer) tt_um_favoritohjs_scroller (VGA Scroller) tt_um_tt08_wirecube (Wirecube) tt_um_vga_glyph_mode (Glyph Mode) tt_um_a1k0n_vgadonut (VGA donut) tt_um_roy1707018 (RO) tt_um_analog_factory_test (TT08 Analog Factory Test) tt_um_sign_addsub (CMOS design of 4-bit Signed Adder Subtractor) tt_um_patater_demokit (Patater Demo Kit Waggling Rainbow on a Chip) tt_um_algofoogle_tt08_vga_fun (TT08 VGA FUN!) tt_um_simon_cipher (simon_cipher) tt_um_thexeno_rgbw_controller (RGBW Color Processor) tt_um_demosiine_sda (DemoSiine) tt_um_bytex64_munch (Munch) tt_um_alexjaeger_ringoscillator (5MHz Ring Oscillator) tt_um_cfib_demo (cfib Demoscene Entry) tt_um_wokwi_407852791999030273 (Simple 8 Bit ALU) tt_um_Richard28277 (4-bit ALU) tt_um_betz_morse_keyer (Morse Code Keyer) tt_um_nvious_graphics (nVious Graphics) tt_um_tiny_pll (Tiny PLL) tt_um_ezchips_calc (8-Bit Calculator) tt_um_hack_cpu (HACK CPU) tt_um_noritsuna_Vctrl_LC_oscillator (Voltage Controlled LC-Oscillator) tt_um_ring_divider (Divided Ring Oscillator) tt_um_morningjava_r2r_from_matt (Bucket Brigade) tt_um_ephrenm_tsal (TSAL_TT) tt_um_kapilan_alarm (Alarm Clock) tt_um_stochastic_addmultiply_CL123abc (Stochastic Multiplier, Adder and Self-Multiplier) tt_um_wokwi_407760296956596225 (tt08-octal-alu) tt_um_dlfloatmac (DL float MAC) tt_um_wakki_0123_Raw_Transistors (Raw_Transistors) tt_um_faramire_rotary_ring_wrapper (Rotary Encoder WS2812B Control) tt_um_devstdin_LDO_OSC (LDO BG IREF OSC) tt_um_frequency_counter (Frequency Counter SSD1306 OLED) tt_um_rom_test (TT08 SKY130 ROM 'YOLO' Test) tt_um_i2c_peripheral_stevej (i2c peripherals: leading zero count and fnv-1a hash) tt_um_yuri_panchul_schoolriscv_cpu_with_fibonacci_program (schoolRISCV CPU with Fibonacci program) tt_um_yuri_panchul_adder_with_flow_control (Adder with Flow Control) tt_um_brailliance (Brailliance) tt_um_nyan (nyan) tt_um_MichaelBell_mandelbrot (VGA Mandelbrot) tt_um_ssp_opamp (2-stage Opamp Designs) tt_um_fountaincoder_top_ad (pulse_add) tt_um_edwintorok (Rounding error) tt_um_mac (MAC) tt_um_dpmu (DPMU) tt_um_JAC_EE_segdecode (7 Segment Decode) tt_um_wokwi_408118380088342529 (Traffic-light-sequence) tt_um_shiftreg_test (TT08 SKY130 Shift Register 'YOLO' Test) tt_um_yuri_panchul_sea_battle_vga_game (Sea Battle) tt_um_benpayne_ps2_decoder (PS2 Decoder) tt_um_meriac_play_tune (Super Mario Tune on A Piezo Speaker) tt_um_comm_ic_bhavuk (Comm_IC) tt_um_daosvik_aesinvsbox (AES Inverse S-box) tt_um_wokwi_408216451206371329 (Logic Test) tt_um_micro_tiles_container (Micro tile container) tt_um_cattuto_sr_latch (TT08 - experiments with latch-based shift registers) tt_um_rejunity_vga_test01 (VGA Drop (audio/visual demo)) tt_um_silice (Warp) tt_um_wokwi_408231820749720577 (Abacus Lock) tt_um_jayjaywong12 (mulmul) tt_um_emmyxu_obstacle_detection (Obstacle Detection) tt_um_neural_navigators (Neural Net ASIC) tt_um_a1k0n_nyancat (VGA Nyan Cat) tt_um_rebeccargb_styler (Styler) tt_um_resfuzzy (resfuzzy) tt_um_cejmu (CEJMU Beers and Adders) tt_um_16_mic_beamformer_arghunter (16 Mic Beamformer) tt_um_pdm_pitch_filter_arghunter (PDM Pitch Filter) tt_um_pdm_correlator_arghunter (PDM Correlator) tt_um_ddc_arghunter (DDC) tt_um_i2s_to_pwm_arghunter (I2S to PWM ) tt_um_georgboecherer_vco (Analog Voltage Controlled Oscillator) tt_um_supermic_arghunter (Supermic ) tt_um_dmtd_arghunter (DMTD ) tt_um_htfab_bouncy_capsule (Bouncy Capsule) tt_um_samuelm_pwm_generator (PWM generator) tt_um_mattvenn_analog_ring_osc (Ring Oscillators) tt_um_toivoh_demo_deluxe (Sequential Shadows Deluxe [TT08 demo competition]) tt_um_faramire_stopwatch (Simple Stopwatch) tt_um_micro_tiles_container_group2 (Micro tile container (group 2)) tt_um_johshoff_metaballs (Metaballs) tt_um_top (Flame demo) tt_um_NicklausThompson_SkyKing (SkyKing Demo) tt_um_Electom_cla_4bits (4-bit CLA) tt_um_vga_cbtest (Generate VGA output for Color Blindness Test) tt_um_zoom_zoom (Zoom Zoom) tt_um_dpmunit (DPM_Unit) tt_um_clock_divider_arghunter (Clock Divider ) tt_um_dlmiles_poc_fskmodem_hdlctrx (FSK Modem +HDLC +UART (PoC)) tt_um_emilian_muxpga (TinyFPGA resubmit for TT08) tt_um_pyamnihc_dummy_counter (Dummy Counter) tt_um_whynot (Why not?) tt_um_sudana_ota5t_1 (5-T OTA) tt_um_dlmiles_tt08_poc_uart (UART) tt_um_dendraws_donut (donut) tt_um_wokwi_408237988946759681 (Counter) tt_um_tmkong_rgb_mixer (RGB Mixer) tt_um_bgr_agolmanesh (Bandgap Reference) tt_um_z2a_rgb_mixer (RGB Mixer demo) tt_um_vga_clock (VGA clock) tt_um_synth_simple_mm (synth_simple) tt_um_gus16 (GUS16 CPU) tt_um_rejunity_ternary_dot (Ternary 128-element Dot Product) tt_um_virantha_enigma (Enigma - 52-bit Key Length) tt_um_atomNPU (AtomNPU) tt_um_alphaonesoc (AlphaOneSoC) tt_um_gxrii_spi_sevenseg (SPI 7-segment display) tt_um_urish_simon (Simon Says memory game) tt_um_branch_pred (TinyTapeout Minimal Branch Predictor) tt_um_xor_encryption (Xor-Logic) tt_um_MAC_Accelerator_OnSachinSharma (MAC Operation) tt_um_moody_mimosa (Moody-mimosa) tt_um_wrapper (6Digit7SegClock) tt_um_MichaelBell_tinyQV (TinyQV Risc-V SoC) tt_um_devmonk_ay8913 (Classic 8-bit era Programmable Sound Generator AY-3-8913) tt_um_toivoh_demo (Orion Iron Ion [TT08 demo competition]) tt_um_mattvenn_r2r_dac_3v3 (Analog 8 bit 3.3v R2R DAC) tt_um_2048_vga_game (2048 sliding tile puzzle game (VGA)) tt_um_test_commit (Microrobotics-Basic-IPs) tt_um_jimktrains_vslc (VSLC - Very Small Logic Controller with a timer and servo control) tt_um_gamepad_pmod_demo (Gamepad Pmod Demo) tt_um_mattvenn_adjustable_psu_counter (Adjustable supply digital counter) tt_um_tinytapeout_logo_screensaver (VGA Screensaver with Tiny Tapeout Logo) tt_um_mattvenn_spi_test (SPI test) tt_um_huffman_coder (Huffmann_Coder) tt_um_multiplier (Vedic multiplier) tt_um_wokwi_422964384478997505 (NAND) tt_um_wokwi_422964754310747137 (DaliaProjekt) tt_um_wokwi_422957918936350721 (TinyTapeout 4 bit ripple carry adder) tt_um_wokwi_422961309631153153 (Tinytapeout_design_ANP) tt_um_wokwi_422957954050029569 (Extremely cool stuff (secret)) tt_um_wokwi_422964381148718081 (test/15/02/25) tt_um_wokwi_422959954857061377 (example1) tt_um_wokwi_422960174616660993 (First design) tt_um_schoeberl_wildcat (Wildcat RISC-V) tt_um_wokwi_422962760920307713 (4 Bit Adder with Overflow Counter) tt_um_kentrane_tinyspectrum (Tiny piano) tt_um_wokwi_422962914561876993 (Emil Njor's Design) tt_um_i2c_regf (Asynchronous I2C Registerfile Interface) tt_um_wokwi_422960054456096769 (3-bit register print) tt_um_wokwi_422960130190575617 (Four basic building blocks) tt_um_wokwi_422965035809389569 (3 Bit Adder) tt_um_wokwi_422958894385882113 (TinyChipDesign) tt_um_tappu_tobias1012 (Tappu) tt_um_wokwi_422960332734617601 (Enter-Code) tt_um_wokwi_422960080008854529 (Special code for letter n) tt_um_wokwi_422957657550394369 (Full Adder) tt_um_mp_lif_schor (mp_LIF_neuron) tt_um_wokwi_422962959838345217 (Holm's TinyTapeOut 4-bit adder) tt_um_asgerwenneb (Custom SRAM) tt_um_wokwi_422960491546730497 (ANDNOT) tt_um_Strider93 (digital LIF Neuron) tt_um_wokwi_422960078645704705 (Hero on Tape) tt_um_wokwi_422959974126748673 (my_own_chip) tt_um_wokwi_422968416190311425 (Encoder) tt_um_wokwi_422962904571040769 (simplePass) tt_um_keszocze_ssmcl (SSMCl) tt_um_luke_clock (TT10_Luke_Clock) tt_um_enjens (Verilog based clock to 7-segment counter) tt_um_wokwi_422968696249282561 (Simple NAND 2) tt_um_wokwi_422960085743520769 (Adder) tt_um_UartMain (XOR Cipher) tt_um_torurstrom_async_lock (Asynchronous Locking Unit) tt_um_larva (LaRVa CPU) tt_um_zhouzhouthezhou_adder (tt10_zhouzhouthezhou_adder) tt_um_bg_DanielZhu123 (Bandgap) tt_um_jp_cd101_saw (KCH CD101 Saw Synth) tt_um_hpdl1414_uart_atudoroi (TT10 HPDL 1414 Uart) tt_um_jun1okamura_test0 (7-segment with LFSR) tt_um_strau0106_simple_viii (simple-viii) tt_um_obriensp_jtag (JTAG TAP) tt_um_10_vga_crossyroad (Crossyroad) tt_um_bilal_trng (TRNG) tt_um_space_invaders_game (Space Invaders ASIC) tt_um_sushi_demo (zc-sushi-demo) tt_um_kch_cd101 (kch cd101) tt_um_uart_bgdtanasa (ttUART) tt_um_zedulo_spitest1 (SimpleSPIdev) tt_um_daobaanh_rng (RNG_test) tt_um_mattvenn_level_shifter (Level Shifter) tt_um_gcd_stephan (15bit GCD) tt_um_alexandercoabad_mixedsignal (Mixed-Signal) tt_um_spacewar (XY Spacewar) tt_um_gregac_tiny_nn (Tiny Neural Network Accelerator) tt_um_log_afpm (16-bit Logarithmic Approximate Floating Point Multiplier) tt_um_rkarl_Spiral (TT_spiralPattern) tt_um_led_jellyant (ledtest) tt_um_project (Simple shift Reg) tt_um_DaDDS (DaDDS) tt_um_nithishreddykvs (Pulse Width Modulation) tt_um_monishvr_fifo (Synchronous FIFO) tt_um_reemashivva_fifo (Asynchronous FIFO) tt_um_save_buffer_hash_table (Tiny Hash Table) tt_um_drum_goekce (DRUM) tt_um_rte_sine_synth (Sine Synth) tt_um_simon2024_c_element_top (Muller C-element) tt_um_tiny_shader_mole99 (Tiny Shader) tt_um_flummer_ltc (Linear Timecode (LTC) generator) tt_um_bitty (Bitty) tt_um_ole_moller_priority_encoder_to_7_segment_decoder (Priority-encoder) tt_um_algofoogle_vga (IHP VGA demo) tt_um_ultra_tiny_cpu (UltraTiny-CPU) tt_um_uwasic_dinogame (UW ASIC - Optimized Dino) tt_um_Qwendu_spi_fpu (SPI FPU) tt_um_rte_eink_driver (E-ink display driver) tt_um_urish_sic1 (SIC-1 8-bit SUBLEQ Single Instruction Computer) tt_um_kianV_rv32ima_uLinux_SoC (KianV uLinux SoC) tt_um_autosel (I2C EEPROM Project Selection) tt_um_tnt_rom_test (TT09 SKY130 ROM Test) tt_um_tnt_rom_nolvt_test (TT09 SKY130 ROM Test (no LVT variant)) tt_um_tt_tinyQV (TinyQV SoC with additional peripherals) tt_um_htfab_dg_dac (Dempsey-Gorman DAC) tt_um_algofoogle_raybox_zero (raybox-zero TTCAD25a edition) tt_um_htfab_checkers (Overengineered Checkers) tt_um_sky130_as_sc_hs (sky130_as_sc_hs test) tt_um_sky130_as_sc_hs_dyn_test (sky130_as_sc_hs dyn test) tt_um_rejunity_z80 (Zilog Z80) tt_um_tnt_rf_yolo_test (TTCAD25a SKY130 RF YOLO Test) tt_um_2x2MatrixMult_Vort3xed (UART Matrix Multiplier) tt_um_zerotoasic_logo_screensaver (VGA Screensaver with Zero to ASIC Logo) tt_um_rejunity_lgn_mnist (LGN hand-written digit classifier (MNIST, 16x16 pixels)) tt_um_wokwi_422192563267712001 (Padlock) tt_um_rc_oscillators (R-C Oscillators) tt_um_tnt_ff_yolo_test (TTCAD25a SKY130 FF YOLO Test) Available Available Available Available Available Available Available Available Available Available Available Available Available Available Available Available Available Available Available Available Available Available Available Available Available Available Available Available Available